SA-MP Forums Archive
OnPlayerCommandReceived help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerCommandReceived help (/showthread.php?tid=552708)



OnPlayerCommandReceived help - kesarthakur - 26.12.2014

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

    if(PlayerInfo[ playerid ][ isAFK ] == 1 && (!strcmp(cmdtext,"/back",true) || !strcmp(cmdtext,"/unjail",true) || !strcmp(cmdtext,"/uncage",true)))
    {
        SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You are Now in AFK/BRB Mode! Try /back to use this cmd!");
        return 0;
    }
    if(Jailed[playerid] == 1 && (!strcmp(cmdtext,"/unjail",true) || !strcmp(cmdtext,"/back",true) || !strcmp(cmdtext,"/uncage",true)))
    {
        SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"you cannot use any command while being jailed!");
        return 0;
    }
    if(Caged[playerid] == 1 && (!strcmp(cmdtext,"/uncage",true) || !strcmp(cmdtext,"/back",true) || !strcmp(cmdtext,"/unjail",true)))
    {
        SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"you cannot use any command while being caged!");
        return 0;
    }
    return 1;
}

Actually this commands should work when PlayerInfo[ playerid ][ isAFK ] == 1 (or) Jailed[playerid] == 1 (or) Caged[playerid] == 1 but they arent working...
they are simply showing error message


Re: OnPlayerCommandReceived help - kesarthakur - 26.12.2014

SOLVED..