Receiving some Errors that can't be solved by me. - 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: Receiving some Errors that can't be solved by me. (
/showthread.php?tid=465820)
Receiving some Errors that can't be solved by me. -
MAFIAWARS - 24.09.2013
So, I made /makeadmin CMD but receiving some errors so I need your Help in Fixing it.
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;
}
Receiving that Errors:
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.
Lines Quoting.
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.
Thank you in Advance.
Re: Receiving some Errors that can't be solved by me. -
DanishHaq - 24.09.2013
What's your enum pInfo?
Re: Receiving some Errors that can't be solved by me. -
MAFIAWARS - 24.09.2013
That is:
pawn Код:
enum PlayerInfo
{
Pass[129], //User's password
pAdminlevel, //User's admin level
pAdminLevel,
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Deaths //User's deaths
}
new pInfo[MAX_PLAYERS][PlayerInfo];
Edit: I want to remove that Helper System because I don't need it anymore.
Re: Receiving some Errors that can't be solved by me. -
Konstantinos - 24.09.2013
Then replace:
pawn Код:
PlayerInfo[iTargetID][pAdmin]
with:
pawn Код:
pInfo[iTargetID][pAdminlevel]
and also replace:
with:
It's supposed that
SendClientMessageEx would format the text itself but since you format it, it doesn't need to use it.