1є - Idente seus cуdigos para melhor compreensгo:
pawn Код:
if(strcmp(cmd,"/setadmin", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerAdmin(playerid))
{
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
return 1;
}
skin = strval(tmp);
if(skin>=6)
{
SendClientMessage(playerid, Vermelho, "(ERRO) O level Permitido para ADM e 0 a 5!");
return 1;
}
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid))
{
if(skin>=1)
{
pAdmin[plid] = skin;
dini_IntSet(file2, "Admin",1); //Codigo que me mandou colar
format(string, sizeof(string), "{FF0000}(INFO){191970}O(A)Dono do server %s (%d) (») Promoveu: %s (%d) {0000FF}para administrador (»){A020F0} Level: %d", aname,playerid,pname,plid,skin);
SendClientMessageToAll(tcadm, string);
}
if(skin == 0)
{
pAdmin[plid] = 0;
SpawnPlayer(plid);
format(string, sizeof(string), "{FF0000}(INFO) {191970}O Admin Rcon %s (%d) (») {0000FF}Retirou admin do jogador: %s {A020F0}(ID: %d)", aname,playerid,pname,plid);
SendClientMessageToAll(tcadm, string);
}
return 1;
}
else
{
SendClientMessage(playerid, Violeta, "(ERRO) Jogador nгo conectado.");
return 1;
}
}
}
Com este cуdigo, se estiver logado na rcon, vai aparecer [ADMIN] atrбs do nome:
pawn Код:
public OnPlayerText(playerid, text[])
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome);
if(IsPlayerAdmin(playerid))
{
new string[128];
format(string, sizeof(string), "{00BFFF}[Admin]{FFFAFA}%s [ID %d] diz : %s", nome, playerid, text);
SendClientMessageToAll(-1, string);
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "{FFFAFA}%s [ID %d] diz : %s", nome, playerid, text);
SendClientMessageToAll(-1, string);
return 1;
// Texto normal dos players que nгo sгo admins
}
}