loop all online names
#1

hi,

im just trying to script an admin function that lists all names of all players currently on the server.
This should be displayed via SendClientMessage.
But how to get all names? How to loop this?
This is what i got so far:

pawn Код:
if (strcmp("/iplist", cmdtext, true) == 0)
{
if(Spieler[playerid][AdminLevel] > 0)//checking if player is admin
{
for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {

new String[128],name[ 30 ];
GetPlayerName( i, name, 30);
format(String,sizeof(String),"Player %s",name);
SendClientMessage(playerid,0xAA3333AA,String);
}
}

}else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");

return 1;
}
e.g. if there are 3 players online: tom,betty,jack.
In this case it would send 3 ClientMessages to the admin that wrote this command like this.
PHP код:
Player tom
Player betty
Player jack 
regards...
Reply


Messages In This Thread
loop all online names - by BlackWolf120 - 27.02.2011, 01:23
Re: loop all online names - by admantis - 27.02.2011, 01:25
AW: loop all online names - by BlackWolf120 - 27.02.2011, 01:28
Re: loop all online names - by Retardedwolf - 27.02.2011, 01:38
AW: loop all online names - by BlackWolf120 - 27.02.2011, 01:42
Re: loop all online names - by (SF)Noobanatior - 27.02.2011, 04:13

Forum Jump:


Users browsing this thread: 3 Guest(s)