16.10.2012, 17:02
Hey,
I have changed my Admin System but now I cannot make admin commands anymore..
It shows a bunch of errors on if(pInfo[playerid][pAdmin] >= 2) { line of code..
Here's freeze command..
Errors are following:
I have changed my Admin System but now I cannot make admin commands anymore..
It shows a bunch of errors on if(pInfo[playerid][pAdmin] >= 2) { line of code..
Here's freeze command..
Errors are following:
pawn Код:
E:\server 3e\pawno\gm232323.pwn(404) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
E:\server 3e\pawno\gm232323.pwn(404) : warning 215: expression has no effect
E:\server 3e\pawno\gm232323.pwn(404) : error 001: expected token: ";", but found "]"
E:\server 3e\pawno\gm232323.pwn(404) : error 029: invalid expression, assumed zero
E:\server 3e\pawno\gm232323.pwn(404) : fatal error 107: too many error messages on one line
PHP код:
CMD:freeze(playerid, params[])
{
if(pInfo[playerid][pAdmin] >= 2) {
new PID;
new reason[64];
new str[128];
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_RED, "[AdminInfo] USAGE: /freeze [id] [reason]");
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
format(str, sizeof(str),"[AdminInfo] '%s' has been frozen by Administrator '%s'. Reason: %s ", Playername, Adminname, reason);
SendClientMessageToAll(COLOR_RED, str);
TogglePlayerControllable(PID,0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have to Be Admin Level 2 to use that command!");
}
return 1;
}