04.11.2016, 00:07
Hey guys, i want to do a command with 3 "variables", /setadmin id level admfunction, like:
/setadmin 1 10 Server Administrator
Pls help me
/setadmin 1 10 Server Administrator
Pls help me
if(strcmp(cmd, "/daradmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [ id ] [level(1-10)]"); SendClientMessage(playerid, COLOR_GRAD2, "Nives de Admins"); SendClientMessage(playerid, COLOR_GRAD2, "1 = Moderador"); SendClientMessage(playerid, COLOR_GRAD2, "2 = Admin"); SendClientMessage(playerid, COLOR_GRAD2, "3 = Admin"); SendClientMessage(playerid, COLOR_GRAD2, "4 = Admin"); SendClientMessage(playerid, COLOR_GRAD2, "5 = Master"); SendClientMessage(playerid, COLOR_GRAD2, "6 = SuperMaster"); SendClientMessage(playerid, COLOR_GRAD2, "7 = SubDono"); SendClientMessage(playerid, COLOR_GRAD2, "10 = Dono"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 10 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pAdmin] >= 10){ format(string, sizeof(string), " Vocк foi promovido para level %d de Admin - Por %s", level, Nome(playerid)); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Admin[%s] Promovido a Level [%d] de Admin.", Nome(para1), level, giveplayer); MensagemAdmin(COLOR_GRAD1,string,1); } PlayerInfo[para1][pAdmin] = level; printf(":Admin: - %s foi promovido por %s a level %d de admin", Nome(para1), Nome(playerid), level); format(string, sizeof(string), " Vocк promoveu %s Para o level %d de Admin.", Nome(para1), level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!"); } } return 1; }