Receiving some Errors that can't be solved by me.
#1

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.
Reply
#2

What's your enum pInfo?
Reply
#3

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.
Reply
#4

Then replace:
pawn Код:
PlayerInfo[iTargetID][pAdmin]
with:
pawn Код:
pInfo[iTargetID][pAdminlevel]
and also replace:
pawn Код:
SendClientMessageEx
with:
pawn Код:
SendClientMessage
It's supposed that SendClientMessageEx would format the text itself but since you format it, it doesn't need to use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)