28.05.2015, 11:20
Deci, in aceasta comanda vreau sa stiu cum pot:
-ca adminul de level 6 sa poata da level admin pana la nivelul 6
si -ca adminul rcon sa poata da level admin pana la nivel 8.
-ca adminul de level 6 sa poata da level admin pana la nivelul 6
si -ca adminul rcon sa poata da level admin pana la nivel 8.
Код:
if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GRAD2, "{B8DBFF}Synthax: /makeadmin [playerid/PartOfName] [level(1-6)]"); return 1; } new level; para1 = ReturnUser(tmp),GetPlayerName(para1, giveplayer, sizeof(giveplayer)); tmp = strtok(cmdtext, idx); level = strval(tmp); if(level > 5) { SCM(playerid, COLOR_GREY, " Nu poti da admin de nivel mai mare decat 5!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 6) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); PlayerInfo[para1][pAdmin] = level; format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername); SCM(para1, COLOR_LIGHTBLUE, string); SetPlayerSkin(playerid, 217); format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "{6790BE}[AdmWarning]{FFFFFF}: %s i-a dat admin[%d] lui %s {FF0000}!",sendername,level,giveplayer); ABroadCast(COLOR_LIGHTRED,string, 5); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "[%02d/%02d/%02d || %02d:%02d:%02d] %s i-a dat admin[%d] lui %s !",d,m,y,h,mi,s,sendername,level,giveplayer); CMDADMLog(string); } } } else { SCM(playerid, COLOR_WHITE, "{FFFFCC}Tu nu ai voie sa folosesti aceasta comanda."); } } return 1; }