24.07.2015, 13:15
i've been getting all these errors on some of the following lines
Код:
CMD:makeadmin(playerid,params)
{
if(!IsPlayerAnAdmin(playerid,6))return SendClientMessage(playerid,COL_RED,"<!>You are not authorized to use this command!");
new adminlvl,rank,pmsg[128],adminmsg[128],string [128],pname,pID;
if(sscanf(params,"ui",pname,adminlvl))return SendClientMessage(playerid,COL_GREEN,"USAGE:/makeadmin [ID] [LEVEL]");
if(rank<0||rank>6)return SendClientMessage(playerid,COL_GREEN,"Please write an acceptable level.");
format(pmsg,sizeof(pmsg),"You have been promoted to level %i by Adminstrator %s",adminlvl,PlayerName(playerid));
format(adminmsg,sizeof(adminmsg),"You have promoted %s to level %i",pname,adminlvl);
SetPVarInt(pID,"Admin",rank);
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAnAdmin(i,1))
{
format(string,sizeof(string),"A: %s [LEVEL %i] used the MAKEADMIN command.",PlayerName(playerid),GetPVarInt(playerid,"Admin"));
SendClientMessage(i,COL_LIGHTBLUE,string);
}
}
}
SendClientMessage(playerid,COL_LIGHTBLUE,adminmsg);
SendClientMessage(pID,COL_LIGHTBLUE,pmsg);
return 1;
}


