24.09.2013, 12:38
So, I made /makeadmin CMD but receiving some errors so I need your Help in Fixing it.
Receiving that Errors:
Lines Quoting.
Thank you in Advance.
pawn Код:
CMD:makeadmin(playerid, params[]) {
if(pInfo[playerid][pAdmin] >= 99999) {
new
iAdminValue,
iTargetID;
if(sscanf(params, "ui", iTargetID, iAdminValue)) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makeadmin [player] [level]");
}
else if(IsPlayerConnected(iTargetID)) {
if(PlayerInfo[iTargetID][pHelper] >= 1) {
SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make community advisors admins!");
}
else {
new
szMessage[47 + (MAX_PLAYER_NAME * 2)];
PlayerInfo[iTargetID][pAdmin] = iAdminValue;
format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin, Well done.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
ABroadCast(COLOR_LIGHTRED,szMessage, 2);
format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
}
}
else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Look here noob your not autherised, now piss off.!");
return 1;
}
pawn Код:
E:\SCRIPT\gamemodes\Dafuq.pwn(761) : error 017: undefined symbol "pAdmin"
E:\SCRIPT\gamemodes\Dafuq.pwn(768) : error 017: undefined symbol "SendClientMessageEx"
E:\SCRIPT\gamemodes\Dafuq.pwn(771) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
E:\SCRIPT\gamemodes\Dafuq.pwn(771) : warning 215: expression has no effect
E:\SCRIPT\gamemodes\Dafuq.pwn(771) : error 001: expected token: ";", but found "]"
E:\SCRIPT\gamemodes\Dafuq.pwn(771) : error 029: invalid expression, assumed zero
E:\SCRIPT\gamemodes\Dafuq.pwn(771) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
pawn Код:
if(pInfo[playerid][pAdmin] >= 99999) { // 761 Line.
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makeadmin [player] [level]"); //Line 768.
if(PlayerInfo[iTargetID][pHelper] >= 1) { // Line 771.