24.04.2012, 15:27
Here all the enum has been added and done
the scripts
pawn Код:
enum pInfo
{
Password,
Cash,
Kills,
Deaths,
Adminlevel,
levels
}
pawn Код:
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.
pawn Код:
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;
}