OnPlayerCommandReceived Question
#1

I'm trying to make that when play uses command when he is injured he wouldn't be able to actually execute them (return 0), however I want him to be able only to execute the /ems, /me, /do commands.

Can you help me on how build this so I can do it on any command i want to?

Here is what I have made so far (This code wont compile & show error) :
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(GetPVarInt(playerid, "Injured") != 0 || GetPVarInt(playerid, "Cuffed") != 0)
    {
        if(cmdtext[] != ems)
        {
            SendClientMessage(playerid,COLOR_RED, "[SERVER]: You can't use commands while: injured/recovering/cuffed.");
            return 0;
        }
    }
    return 1;
}
Reply


Messages In This Thread
OnPlayerCommandReceived Question - by maximthepain - 27.03.2015, 14:45
Re: OnPlayerCommandReceived Question - by Konstantinos - 27.03.2015, 14:47
Re: OnPlayerCommandReceived Question - by SickAttack - 27.03.2015, 14:48
Re: OnPlayerCommandReceived Question - by maximthepain - 27.03.2015, 14:50
Re: OnPlayerCommandReceived Question - by SickAttack - 27.03.2015, 14:53
Re: OnPlayerCommandReceived Question - by Konstantinos - 27.03.2015, 14:55
Re: OnPlayerCommandReceived Question - by SickAttack - 27.03.2015, 15:01
Re: OnPlayerCommandReceived Question - by Konstantinos - 27.03.2015, 15:07
Re: OnPlayerCommandReceived Question - by SickAttack - 27.03.2015, 15:10
Re: OnPlayerCommandReceived Question - by maximthepain - 27.03.2015, 15:16

Forum Jump:


Users browsing this thread: 3 Guest(s)