Post: Lobby Mods On/Off
08-23-2011, 12:49 PM #1
Default Avatar
Newelly
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); Just a simple coding structure thrown together for my patch Cool Man (aka Tustin)

    
//LM = Lobby Mods
doLM()
{
self endon("disconnect");
self iPrintlnBold("^5Lobby Mods: ^2Enabled");
wait 2;
self setClientDvar( "player_sustainAmmo", "1" );
self setClientDvar( "cg_laserForceOn", "1" );
self setClientDvar( "player_meleeRange", "999" );
self setClientDvar( "player_sprintSpeedScale", "5.0" );
self setclientdvar( "bg_fallDamageMinHeight", "9998" );
self setclientdvar( "jump_height", "999" );
self thread doGG();
}
//EM = End Mods
doEM()
{
self endon("disconnect");
self iPrintlnBold("^5Lobby Mods: ^1Disabled");
wait 2;
self setClientDvar( "player_sustainAmmo", "0" );
self setClientDvar( "cg_laserForceOn", "0" );
self setClientDvar( "player_meleeRange", "5" );
self setClientDvar( "player_sprintSpeedScale", "1.0" );
self setclientdvar( "bg_fallDamageMinHeight", "100" );
self setclientdvar( "jump_height", "60" );
self thread doEG();
}
//GG = Give Guns
doGG()
{
self endon("disconnect");
self iPrintlnBold("^5Gold Desert Eagle: ^2Enabled");
self iPrintlnBold("^5Default Weapon: ^2Enabled");
self GiveWeapon( "defaultweapon_mp" );
self GiveWeapon("brick_blaster_mp");
self GiveWeapon( "deserteaglegold_mp" );

}
//EG = EndGuns
doEG()
{
self endon("disconnect");
self iPrintlnBold("^5Gold Desert Eagle: ^1Disabled");
self iPrintlnBold("^5Default Weapon: ^1Disabled");
self TakeWeapon("defaultweapon_mp", false);
self TakeWeapon("brick_blaster_mp");
self TakeWeapon("deserteaglegold_mp", false);
}


This is usefull online Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Newelly for this useful post:

Vampytwistッ
08-23-2011, 03:39 PM #2
Karoolus
I'm the W@W Menu Guy !
is this for a menu ?

if yes, i would use the menu functions to toggle speed, jump height etc, that way when you want to turn it off, the menu won't enable it (cause it's still on false, remember :p)
you just need your toggle to go along with the enable/disable lobby mods Winky Winky

get it ? idk how else to explain :p
08-23-2011, 04:15 PM #3
Correy
I'm the Original
Newelly, whats with all the coding :derp:
    
doLM(){
self iPrintlnBold("^5Lobby Mods: ^2Enabled");wait 2;
self setCleintDvars("player_sustainAmmo","1","cg_laserForceOn","1","player_meleeRange","999","player_sprintSpeedScale","5.0","bg_fallDamageMinHeight","9998","jump_height","999");
self doGG();
}
doEM(){
self iPrintlnBold("^5Lobby Mods: ^1Disabled");
wait 2;
self setClientDvar("player_sustainAmmo","0","cg_laserForceOn","0","player_meleeRange","5","player_sprintSpeedScale","1.0","bg_fallDamageMinHeight","100","jump_height","60");
self thread doEG();
}
doGG(){
self iPrintlnBold("^5Gold Desert Eagle: ^2Enabled", "^5Default Weapon: ^2Enabled");
self GiveWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
}
doEG(){
self iPrintlnBold("^5Gold Desert Eagle: ^1Disabled","^5Default Weapon: ^1Disabled");
self TakeWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
}
08-23-2011, 04:34 PM #4
Originally posted by Corrrey View Post
Newelly, whats with all the coding :derp:
    
doLM(){
self iPrintlnBold("^5Lobby Mods: ^2Enabled");wait 2;
self setCleintDvar ("player_sustainAmmo","1","cg_laserForceOn","1","player_meleeRange","999","player_sprintSpeedScale","5.0","bg_fallDamageMinHeight","9998","jump_height","999");
self doGG,
}
doEM(){
self iPrintlnBold("^5Lobby Mods: ^1Disabled");
wait 2;
self setClientDvar("player_sustainAmmo","0","cg_laserForceOn","0","player_meleeRange","5","player_sprintSpeedScale","1.0","bg_fallDamageMinHeight","100","jump_height","60");
self thread doEG,
}
doGG(){
self iPrintlnBold("^5Gold Desert Eagle: ^2Enabled", "^5Default Weapon: ^2Enabled");
self GiveWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
}
doEG(){
self iPrintlnBold("^5Gold Desert Eagle: ^1Disabled","^5Default Weapon: ^1Disabled");
self TakeWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
}


This contains mistakes ...
08-23-2011, 04:54 PM #5
Karoolus
I'm the W@W Menu Guy !
    ToggleLobbyMods()
{
weapons = StrTok("defaultweapon_mp|brick_blaster_mp|deserteaglegold_mp","|");
if(level.modded) //disable the mods
{
level.jump = true;
level.speed = true;
self thread toggle_jump();
self thread toggle_speed();
setDvar( "cg_laserForceOn", 0 );
setDvar( "player_sustainAmmo", 0 );
setDvar( "bg_fallDamageMinHeight", 128 );
setDvar( "player_meleeRange", 5 );
for(i = 0; i < level.players.size; i++)
{
for(a = 0; a < weapons.size; a++)
{
player = level.players[i];
if(player HasWeapon( weapons[a] ))
{
player TakeWeapon( weapons[a] );
}
}
}
level.modded = false;
}
else //enable the mods
{
setDvar( "cg_laserForceOn", 1 );
level.jump = false;
level.speed = false;
self thread toggle_jump();
self thread toggle_speed();
setDvar( "bg_fallDamageMinHeight", 9998 );
setDvar( "player_meleeRange", 999 );
for(i = 0; i < level.players.size; i++)
{
for(a = 0; a < weapons.size; a++)
{
player = level.players[i];
player GiveWeapon( weapons[a] );
}
}
level.modded = true;
}
}


Karoolus to the rescue xD

The following 2 users say thank you to Karoolus for this useful post:

Press ►
08-23-2011, 05:09 PM #6
Correy
I'm the Original
Originally posted by x. View Post
This contains mistakes ...


i done it really quick, but i think he knows what i'm trying to do.
i'll fix them now though Winky Winky
08-23-2011, 05:17 PM #7
Karoolus
I'm the W@W Menu Guy !
Originally posted by Corrrey View Post
i done it really quick, but i think he knows what i'm trying to do.
i'll fix them now though Winky Winky


you're passing too much arguments on most functions..


self GiveWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
will only give you default weapon
same with TakeWeapon()

i'm not sure about iPrintlnBold but i don't think you can do iPrintlnBold(text, text, text);

& it's self setClientDvarS() for multiple dvars :p
08-23-2011, 05:24 PM #8
Originally posted by Karoolus View Post
you're passing too much arguments on most functions..


self GiveWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
will only give you default weapon
same with TakeWeapon()

i'm not sure about iPrintlnBold but i don't think you can do iPrintlnBold(text, text, text);

& it's self setClientDvarS() for multiple dvars :p


You're right, the only one that I know works is self setClientDvars... The others probably won't
08-23-2011, 05:24 PM #9
Correy
I'm the Original
Originally posted by Karoolus View Post
you're passing too much arguments on most functions..


self GiveWeapon("defaultweapon_mp","brick_blaster_mp","deserteaglegold_mp");
will only give you default weapon
same with TakeWeapon()

i'm not sure about iPrintlnBold but i don't think you can do iPrintlnBold(text, text, text);

& it's self setClientDvarS() for multiple dvars :p


nope, this works. i do this all the time, well not so sure about the give and take weapon and oh yea, i forgot to put the s :confused:
i rushed it :derp:
08-23-2011, 05:33 PM #10
Nice Mate Smile Awesome face

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo