29.01.2015, 02:57
pawn Код:
CMD:setadmin(playerid, params[])
{
new id, level, string[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo й um Administrador Logado Na RCON.");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Use /setadmin [id] [LEVEL]");
if (level < 0 || level > 5) return SendClientMessage(playerid, -1, "Level invбlido. Use de 1 б 5 .");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб online.");
GetPlayerName(id, ganhou, sizeof(ganhou));
GetPlayerName(playerid, deu, sizeof(deu));
format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
SendClientMessage(playerid, -1, string);
format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
SendClientMessage(id, -1, string2);
pAdmin[id][Level] = level;
return 1;
}
pawn Код:
CMD:setadmin(playerid, params[])
{
new id, level, string[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo й um Administrador Logado Na RCON.");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Use /setadmin [id] [LEVEL]");
if (level < 0 || level > 5) return SendClientMessage(playerid, -1, "Level invбlido. Use de 1 б 5 .");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб online.");
GetPlayerName(id, ganhou, sizeof(ganhou));
GetPlayerName(playerid, deu, sizeof(deu));
format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
SendClientMessage(id, -1, string);
pAdmin[id][Level] = level;
return 1;
}
3) E por ъltimo, para facilitar sua vida, use uma funзгo para retornar o nome do jogador:
pawn Код:
PlayerName(playerid)
{
new nomej[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomej, sizeof(nomej));
return nomej;
}
pawn Код:
new arquivi[34], nomeplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomeplayer, sizeof(nomeplayer));
format(arquivi, sizeof(arquivi), "Admins/%s.ini", nomeplayer);
pawn Код:
new arquivi[34];
format(arquivi, sizeof(arquivi), "Admins/%s.ini", PlayerName(playerid));