11.09.2012, 00:58
pInfo[iTarget][pAdmin] = Level; is setting the admin level pretty much. Here is a basic command to set someone's admin level.
Suggest reading a tutorial on this kind of stuff. Here is a great one for you!
https://sampforum.blast.hk/showthread.php?tid=318307
Код:
CMD:makeadmin(playerid,params[]) { if(pInfo[playerid][pAdmin] >=5 || IsPlayerAdmin(playerid)) { new iTarget,Level,String[128],StringTwo[128],LogString[128],AdmRank[50]; if(sscanf(params,"ud",iTarget,Level)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /makeadmin [Playerid (or Name)] [Admin Level]"); if(Level < 1 || Level > 5) return SendClientMessage(playerid, COLOR_GREY,"Error: Invalid Admin Level. [Admin Level 1 - 5]"); if(iTarget == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"Error: Player Not Connected!"); { pInfo[iTarget][pAdmin] = Level; } } else { SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!"); } return 1; }
https://sampforum.blast.hk/showthread.php?tid=318307