enum pInfo
{
Password,
Cash,
Kills,
Deaths,
Adminlevel,
levels
}
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1545) : warning 219: local variable "levels" shadows a variable at a preceding level
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : warning 215: expression has no effect
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : error 001: expected token: ";", but found "]"
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : error 029: invalid expression, assumed zero
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:setadmin(playerid, params[])
{
((LINE 1545)) new id, levels, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
if(sscanf(params,"ui", id, levels)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /givemoney [playerid/partofname] [ammount]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
((THIS IS THE LINE 1549)) if(pInfo[id][AdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!");//Detect if the guy is already the level you setted
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
GetPlayerName(id,pname,MAX_PLAYER_NAME);//define the other person name
if(levels == 0)
{
format(str, sizeof(str),"%s has your Admin level to %d on the server. *cry *cry",Nam,levels);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerData[ID][AdminLevel] = levels;//this sets the player level
return 1;
}
format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,levels);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerData[ID][AdminLevel] = levels;
return 1;
}
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1548) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1548) : warning 215: expression has no effect
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1548) : error 001: expected token: ";", but found "]"
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1548) : error 029: invalid expression, assumed zero
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1548) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(pInfo[id][AdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!")
CMD:setadminlevel(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] == 6)
{
new target, level, targetid;
if(sscanf(params, "ri", target, level)) return SendClientMessage(playerid, 0xCC0000AA, "Server: /setadminlevel [playerid] [level]");
if(level > 5) return SendClientMessage(playerid, 0xCC0000AA, "The maximum level is 5!");
PlayerInfo[target][pAdminLevel] = level;
new aName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, sizeof(aName));
GetPlayerName(target, tName, sizeof(tName));
new string[128];
format(string, sizeof(string), "|| You set %s(%d) to admin level %d! ||", tName, targetid, level);
SendClientMessage(playerid, 0x0000FF, string);
format(string, sizeof(string), "Administrator %s has set your admin level to %d!", aName, level); //like above
SendClientMessage(target, 0x0000FF, string);
format(string, sizeof(string), "%s(%d) has just been made apart of the team! Well done!", tName, targetid);
}
else return SendClientMessage(playerid, 0xCC0000AA, "Warning: You are a high enough Admin Level!");
return 1;
}
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1544) : error 017: undefined symbol "AdminLevel"
D:\gta.sa\BaseNorton V2\gamemodes\Test.pwn(1549) : error 017: undefined symbol "AdminLevel"
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "%s(%d) has just been made apart of the team! Well done!", tName, targetid);
Well left with two Error
pawn Код:
|
CMD:setadminlevel(playerid, params[])
{
if(PlayerInfo[playerid][pAdminlevel] == 6)
{
new target, level, targetid;
if(sscanf(params, "ri", target, level)) return SendClientMessage(playerid, 0xCC0000AA, "Server: /setadminlevel [playerid] [level]");
if(level > 5) return SendClientMessage(playerid, 0xCC0000AA, "The maximum level is 5!");
PlayerInfo[target][pAdminlevel] = level;
new aName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, sizeof(aName));
GetPlayerName(target, tName, sizeof(tName));
new string[128];
format(string, sizeof(string), "|| You set %s(%d) to admin level %d! ||", tName, targetid, level);
SendClientMessage(playerid, 0x0000FF, string);
format(string, sizeof(string), "Administrator %s has set your admin level to %d!", aName, level); //like above
SendClientMessage(target, 0x0000FF, string);
format(string, sizeof(string), "%s(%d) has just been made apart of the team! Well done!", tName, targetid);
}
else return SendClientMessage(playerid, 0xCC0000AA, "Warning: You are a high enough Admin Level!");
return 1;
}
Use this
pawn Код:
|
Use this
pawn Код:
|