pawn Код:
CMD:makeadmin(playerid,params[])
{
if(IgracLogiran[playerid] != 1)
{
SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Morate biti logirani za koristenje ove komande!");
return 1;
}
if(PlayerInfo[playerid][Admin] >= 1338 || IsPlayerAdmin(playerid))
{
new id,level,hIme[2][MAX_PLAYER_NAME],string[220];
if(sscanf(params,"ui",id,level)) return SCM(playerid,COLOR_GRAD2,"{FFAF00}Koristite: {FFFFFF}/makeadmin [Korisnicki ID ili Ime Korisnika] [Admin Level [1-1338] ]");
if(!IsPlayerConnected(id)) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}Pogresan ID Korisnika!");
RPIme(playerid,hIme[0]);
RPIme(id,hIme[1]);
for(new i = 1; i < 21; i++)
{
if(!strcmp(AdminInfo[i][Place],"Nitko",true))
{
strmid(AdminInfo[i][Place],hIme[1],0,strlen(hIme[1]),255);
PlayerInfo[id][AdminPlace] = i;
PlayerInfo[id][Admin] = level;
format(string,128,"*You get %d level of admin | Head Admin: %s",level,hIme[0]);
SCM(id,SVIJETLOPLAVA,string);
format(string,128,"*You set %s to %d level Admin.",hIme[1],level);
SCM(playerid,SVIJETLOPLAVA,string);
new query[128];
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `AdminPlace` = '%d',`Admin` = '%d' WHERE `ID` = '%d'",i,level,PlayerInfo[playerid][ID]);
mysql_tquery(mysql,query,"","");
SaveAdmins(1);
break;
}
}
}
else return SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Samo Admini(rcon +)!");
return 1;
}
know this is all fine and this write all levels of admin here is strmid(AdminInfo[i][Place],hIme[1],0,strlen(hIme[1]),255); that mean admininfo every time when someone get admin it go Admin 1: Name Admin2: Name etc... if you know what I mean