Few errors, please help.
#1

The errors:

Код:
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(423) : error 017: undefined symbol "ID"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(424) : error 017: undefined symbol "levels"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(425) : error 017: undefined symbol "ID"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(425) : error 017: undefined symbol "red"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\------(426) : error 017: undefined symbol "PlayerData"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн-----(426) : error 017: undefined symbol "ID"
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(426) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\щемзп дтбегд\ъйчйеъ дозщб\чйгегйн есчшйфийн\-----(426) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Lines:

Код:
CMD:setadmin(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))return 0;
    if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,0xFF9900AA, "Correct Syntax: /setadmin [ID] [level 1-20]");//it will show this if you dont use the format properly
    if(levels > 20) return SendClientMessage(playerid,0xFF0000FF,"шоеъ жойреъ: 20");//Available levels
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"!дощъощ щвей ае айре озебш");//Detect if the id/partofname is connected
    if(PlayerData[ID][AdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "!бтйд рецшд, дощъощ дйре лбш бшоъ дже");//Detect if the guy is already the level you setted
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);
    if(levels == 0)
    {
        format(str, sizeof(str),"%s has set your admin level to %d, enjoy!",Nam,levels);
        SendClientMessage(ID,0xFF9900AA,str);
        format(str, sizeof(str),"You have set %s admin level to %d!",pname,levels);
        SendClientMessage(playerid,0xFF9900AA,str);
        PlayerData[ID][AdminLevel] = levels;
        return 1;
    }
    format(str, sizeof(str),"%s has set your admin level to %d, enjoy!",Nam,levels);
    SendClientMessage(ID,0xFF9900AA,str);
    format(str, sizeof(str),"You have set %s admin level to %d!",pname,levels);
    SendClientMessage(playerid,0xFF9900AA,str);
    PlayerData[ID][AdminLevel] = levels;
    return 1;
}
Thanks for the helpers.
Reply
#2

This command isn't meant for standalone use, did you rip it off a script?
Reply
#3

Absolutley no, I followed a tutorial.
You are right, forgot more lines:

Код:
enum pData

{
    AdminLevel
};
new PlayerData[MAX_PLAYERS][pData];
new levels,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;

enum pInfo
{
  pPass,
  pCash,
  pAdmin,
  pKills,
  pDeaths,
  Frozen
}

stock PlayerName(playerid)
            {
            new pName[25];
            GetPlayerName(playerid, pName, sizeof(pName));
            return pName;
            }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)