Player Say

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!

**[Gamemode.PlayerSay

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerSay)**

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.


function ISaid( ply, text, public )
    if (string.sub(text, 1, 4) == "!vip") then
     ply:ConCommand("info_elite")
    end
end
hook.Add( "PlayerSay", "ISaid", ISaid );

[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 (: