How do i create a /playerlist? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do i create a /playerlist? (
/showthread.php?tid=369027)
How do i create a /playerlist? -
Beastlynoob - 15.08.2012
Ok so im trying to create a /playerlist that show all players online and their level in this format:
playername (VirtualWorld) (Level)
playername (VirtualWorld) (Level)
playername (VirtualWorld) (Level)
.. and so on for each player.
I can get the player his name but i dont know how to get all players name and info.Could somebody help me out with this please?
Re: How do i create a /playerlist? -
IceMeteor - 15.08.2012
pawn Код:
CMD:playerlist(playerid, params[])
{
new VW, Score, name[MAX_PLAYER_NAME], string[1024];
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(playerid))
{
VW = GetPlayerVirtualWorld(i);
Score = GetPlayerScore(i);
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s | %d | %d", name, VW, Score);
SendClientMessage(playerid, -1, string);
}
}
return 1;
}