• Making things happen when a ConVar Value is 1
    2 replies, posted
Hi, I want players to have their Weapons stripped and gain a Crowbar when the Crowbar_Crazy Convar is set to one and all Weapons for Classes replaced with a Crowbar. How would I do that?
[b][url=http://wiki.garrysmod.com/?title=Cvars.AddChangeCallback]Cvars.AddChangeCallback [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
If the convar already exists then something like the following. [lua] if( string.match(GetConVarString("crowbar_crazy"), "1") ) then --(whatever the crap is to strip a player then something like) ply:give "weapon_crowbar" -- or something along those lines [/lua]
Sorry, you need to Log In to post a reply to this thread.