AFKLIST - 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: AFKLIST (
/showthread.php?tid=292010)
AFKLIST -
wumpyc - 22.10.2011
Hey im making afklist but i have some problems...player id 0 can see everyone which is AFK..others can see only one player that is afk
PHP код:
CMD:afklist(playerid,params[])
{
new count = 0,
string[128],
pName[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerIsAFK[i] == 1)
{
GetPlayerName(i, pName,sizeof(pName));
format(string, sizeof(string), "Player: {99EE22}%s, {992233}ID: {99DDDD}%d", pName, i);
ShowPlayerDialog(playerid,837,DIALOG_STYLE_LIST,"AFK PLAYERS:",string,"OK","Cancel");
count++;
}
}
}
if (count == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "No one AFK!");
}
return 1;
}
Re: AFKLIST -
KoczkaHUN - 22.10.2011
pawn Код:
CMD:afklist(playerid,params[])
{
new count = 0, string[4096], pName[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (GetPlayerName(i, pName,sizeof(pName)))
{
if(PlayerIsAFK[i] == 1)
{
format(string, sizeof(string), "%sPlayer: {99EE22}%s, {992233}ID: {99DDDD}%d\n",
string, pName, i);
count++;
}
}
}
if (count == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "No one AFK!");
} else ShowPlayerDialog(playerid,837,DIALOG_STYLE_LIST,"AFK PLAYERS:",string,"OK","Cancel");
return 1;
}
Re: AFKLIST -
wumpyc - 22.10.2011
THANKS DUDE, i changed string[4096] to 2500...you deserver thousands of reps.
.GOT A REP XD
Re: AFKLIST -
Rafiko - 22.10.2011
Works fantastic ty man!