10.10.2011, 14:59
Ola Pessoal Do Forum Samp Vim Pedir uma Ajuda Bem Util, Porque Quando eu Min Dou Admin no Meu Server Dai Quando eu saio e Entro Denovo Eu Nгo Tou mais de ADMIN? Aki ta O Codigo deo /daradmin '-'
PHP код:
if(strcmp(cmd, "/daradmin", true) == 0 || strcmp(cmd, "/daradminnivel", true) == 0)
{
new player[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 10 && !IsPlayerAdmin(playerid)) return DenyMessage(playerid, 10);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /daradmin ou /daradminnivel [playerid] [AdminLNivel]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "id invalido.");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][pAdmin] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "Admin \"%s\" te pos como admin nl %d.",player, level);
SendClientMessage(giveplayerid, COLOR_GREEN, string);
format(string, sizeof(string), "Vocк deu admin a \"%s\" nivel %d admin.", giveplayer, PlayerInfo[giveplayerid][pAdmin]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}