02.03.2012, 00:34
Код:
if(strcmp(cmd, "/editarhelper", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /editarhelper [playerid/ParteDoNome] [level(0-30)]"); return 1; } new playa; new level; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if(level < 0 || level > 30) { SendClientMessage(playerid, COLOR_GREY, "** Nнvel nгo pode ser inferior a 0 ou acima de 30!"); return 1; } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); PlayerInfo[playa][pHelper] = level; format(string, sizeof(string), "** Vocк definiu o nivel de helper de %s[ID:%d] para [%d]",giveplayer,playa,level); SendClientMessage(playerid, COLOR_ORANGE, string); format(string, sizeof(string), "** Admin %s[ID:%d] definiu seu nivel de helper para [%d]",sendername,playerid,level); SendClientMessage(playa, COLOR_ORANGE, string); format(string, sizeof(string), "[HELPER]%s[ID %d] й o novo helper do servidor",giveplayer,playa); SendHelperMessage(COLOR_HELPER,string); format(string, sizeof(string), "~b~Parabens %s voce agora e um Helper",giveplayer); GameTextForPlayer(playa, string, 4500,3); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "** vocк nгo estб autorizado a usar esse comando!"); } } return 1; }