01.07.2011, 15:04
Код:
if(strcmp(cmd,"/setadmin",true) == 0) { tmp = strtok(cmdtext, idx); new player[MAX_PLAYER_NAME]; if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5) { if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USE: /daradmin [id] [nнvel]"); if(!IsNumeric(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"[AVISO] Por favor digite o ID do Player."); if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid,COLOR_WHITE,"[ERRO] Jogador indisponнvel."); giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new Level = strval(tmp); new playername[24]; GetPlayerName(giveplayerid, playername, sizeof(playername)); format(file,sizeof(file),"Contas/%s.ini",playername); dini_Create(file); dini_IntSet(file,"Level", Level); PlayerInfo[giveplayerid][Admin] = dini_Int(file,"Level"); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); format(string, sizeof(string), "{FFFF00}Adm.Cmd:{33AAFF} O Administrador %s deu para vocк [Level %d] de Administrador!",player, Level); SendClientMessage(giveplayerid, COLOR_WHITE, string); format(string, sizeof(string), "{FFFF00}Adm.Cmd:{33AAFF} Vocк deu para %s [Level %d] de Administrador!", giveplayer, Level); SendClientMessage(playerid, COLOR_WHITE, string); } else if(PlayerInfo[playerid][Admin] < 5) return SendClientMessage(playerid,COLOR_RED, "[ERRO] Vocк nгo й Administrador!"); return 1; }