Hi
I was wondering how can I make a ChatCommand for example If a player says !vip it runs the console command checkvip I've had a issue with this and done a bit of goggling but had no choice but to ask here
Thanks in advance!
[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSay]Gamemode.PlayerSay [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
The example on that page should give you an idea.
Thank you so much I got it working!!! (:
Hi again,
I cant seem to make another one for !admin this is what I have so far could you help.
[CODE]function ISaid( ply, text, public )
if (string.sub(text, 1, 4) == "!vip") then
ply:ConCommand("info_elite")
end
end
hook.Add( "PlayerSay", "ISaid", ISaid );[/CODE]
[lua]
function ISaid( ply, text, public )
if (string.sub(text, 1, 4) == "!vip") then
ply:ConCommand("info_elite")
elseif (string.sub(text, 1, 6) == "!admin") then
ply:ConCommand("IdontKnow")
end
end
hook.Add( "PlayerSay", "ISaid", ISaid );
[/lua]
Try that.
Yes worked thank you (:
Sorry, you need to Log In to post a reply to this thread.