Undefined symbol "playerid"
#5

this will not work because playerid is not there in the callback..
you ahd rather create this command using your normal command processor and then before the command check if player is admin or not using if(!IsPlayerAdmin(playerid))

example -
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/god", true))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not an admin");
        SendClientMessageToAll(0xDEEE20FF, "An admin has enabled his GODMODE!");
        SetPlayerHealth(playerid, 9999999999999999999999);
        SetPlayerArmour(playerid, 9999999999999999999999.0);
        return 1;
       
    }
if(!strcmp(cmd,"/ungod",true))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not an admin");  
    SendClientMessageToAll(0xDEEE20FF, "An admin has disabled his GODMODE!");
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0.0);
    }
    return 0;
   
}
Reply


Messages In This Thread
Undefined symbol "playerid" - by NicholasA - 27.11.2012, 15:54
Re: Undefined symbol "playerid" - by Jarnu - 27.11.2012, 15:56
Re: Undefined symbol "playerid" - by [KHK]Khalid - 27.11.2012, 15:57
Re: Undefined symbol "playerid" - by NicholasA - 27.11.2012, 15:57
Re: Undefined symbol "playerid" - by [HK]Ryder[AN] - 27.11.2012, 15:59
Re: Undefined symbol "playerid" - by Raximax - 27.11.2012, 15:59
Re: Undefined symbol "playerid" - by NicholasA - 27.11.2012, 16:01
Re: Undefined symbol "playerid" - by Jarnu - 27.11.2012, 16:01
Re: Undefined symbol "playerid" - by NicholasA - 27.11.2012, 16:03
Re: Undefined symbol "playerid" - by Raximax - 27.11.2012, 16:07

Forum Jump:


Users browsing this thread: 2 Guest(s)