01.05.2011, 09:22
pawn Код:
if(strcmp(cmd, "/setadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/asetadmin [playerid] [adminlevel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, name, sizeof(name));
if(strcmp(name, "Pedro_Nobre", true) == 0 || strcmp(name, "Rui_Amoroso", true) == 0)
{
PlayerInfo[para1][pAdmin] = level;
format(string, sizeof(string), "%s has just made you administrator level: %d.", GetPlayerNameEx(playerid),level);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), "%s foste escolhido para administrador - Level: %d.", GetPlayerNameEx(para1),level);
SendClientMessage(playerid, COLOR_WHITE, string);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "O admin %s definiu ao jogador %s o nivel de admin [%d].", sendername, GetPlayerNameEx(para1), level);
AdministratorMessage(COLOR_ORANGE, string,1);
CommandLog(string);
}
else
{
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo es administrador ou nгo tens nivel suficiente.");
}
}
return 1;
}
espero ter ajudado.