• Need Help Coding A Custom Server Command For VIP Users
    4 replies, posted
So on my server you can pay for VIP rank and if you are VIP you get certain items. Well, I have a script that makes admin's, super admin's, and vip's physgun rainbow and cycle between colors. I want to make it so when a VIP only types in chat "!vipphysgun", they can turn rainbow physgun on or off. Please help me make this!
If your script is serverside, you may want to use the hook [url=http://wiki.garrysmod.com/page/GM/PlayerSay]GM:PlayerSay[/url] in order to detect the command. An example of its correct usage: [code] hook.Add( "PlayerSay", "MyCommand", function( ply, text, team ) if ( string.sub( text, 1, 8 ) == "!command" ) then -- if characters 1 thru to 8 are "!command" then enableRainbowForPlayer(ply) -- Do your thing here return false -- Prevents the message from displaying in the chat. end -- Don't return anything if we didn't find what we are looking for end ) [/code] Alternatively, if your script is clientside, try using [url=http://wiki.garrysmod.com/page/GM/OnPlayerChat]GM:OnPlayerChat[/url] instead of [url=http://wiki.garrysmod.com/page/GM/PlayerSay]GM:PlayerSay[/url]
Ok so it's serverside but how can I find the console command for it so it activates [editline]16th September 2016[/editline] or is that the full working code? [editline]16th September 2016[/editline] and where would I put that code?
[QUOTE=Revenance;51062064]Ok so it's serverside but how can I find the console command for it so it activates [editline]16th September 2016[/editline] or is that the full working code? [editline]16th September 2016[/editline] and where would I put that code?[/QUOTE] watch at least half a lua tutorial before asking stupid questions like these, nobody knows anything about how your rainbow shit works so they can't give you full source
nvm can someone just help me with this
Sorry, you need to Log In to post a reply to this thread.