09.09.2013, 21:37
pawn Код:
COMMAND:vips(playerid, params[])
{
new VIPList[500], Name[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][VIPLevel] > 0)
{
// Add all admin players to the list
format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, VIPLevelName[APlayerData[i][VIPLevel]]);
continue;
}
}
}
// Check if there were admin-names added to the list
if (strlen(VIPList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Players Vips Online no LTB:", VIPList, "Ok", "Cancelar");
else
SendClientMessage(playerid, 0xFF0000FF, "Nenhum Player vip Online");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}