I wanted to use this:-
else if( stats[ player.ID ].Logged )
{
if( cmd.slice(0,1) == "!" && cmd.len() > 1 )
{
RegUserCmds( player, cmd.slice(1), text );
}
else if( cmd.slice(0,1) == "/" && cmd.len() > 1)
{
RegUserCmds( player, cmd.slice(1), text );
}
}
But unfortunately it doesn't work, can anyone tell me the problem?
Obviously this goes into onPlayerChat() Have you tested this with a hardcoded string? have you printed cmd to confirm it has what you expect? have you printed the result of slice? ffs have you done any debugging?
Please consult the following (http://forum.vc-mp.org/?topic=1529.0).
anything typed with ' / ' in the beginning is not recognized as chat . So you have to make it in on player command.
Update 1 : is it onplayerchat or onplayercommand , you had put cmd.slice so i guess it is onplayercommand , when a player types command it removes '/' from it . so player should type /!command or //command to make it work
I already got it!, no need