23.08.2015, 20:54
when i do the cmd it makes the player an adminstrator and saves his rank in his Users file but when that player rejoins his level is 0 , here's the cmd
Thanks
Код:
CMD:makeadmin(playerid,params[]) { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFF0000FF,"<!>You are not authorized to use this command!"); new pID,rank,string1[128],string2[128],string3[128]; if(sscanf(params,"ui",pID,rank))return SendClientMessage(playerid,COL_GREEN,"/makeadmin [id] [level]"); if(rank<0||rank>6)return SendClientMessage(playerid,COL_GREEN,"Please write an acceptable level."); SetPVarInt(pID,"Admin",rank); PlayerInfo[pID][pAdmin] = rank; format(string1,sizeof(string1),"You promoted %s to level %i",PlayerName(pID),rank); GameTextForPlayer(playerid,"~r~PROMOTED",3000,4); format(string2,sizeof(string2),"* You are promoted to level %i. Try /admincommands [%i] to see the commands you can use now.",rank,rank); for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(IsPlayerAnAdmin(i,1)) { format(string3,sizeof(string3),"A: %s [LEVEL: %i] used the MAKEADMIN command.",PlayerName(playerid),GetPVarInt(playerid,"Admin")); SendClientMessage(i,COLOR_ORANGE,string3); } } } SendClientMessage(playerid,COLOR_LIGHTBLUE,string1); SendClientMessage(pID,COLOR_ORANGE,string2); return 1; }