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=344472)
AFKList -
JaKe Elite - 21.05.2012
Hey guys.
I want to change my AFKList, My AFK List creates 1 line everytime there is Player AFK
i don't wanna have big big big long dialog that list many AFK Players.
How can i make like this?
Код:
Romel(0), John(1), Ruzie(5)
instead of
Код:
Romel(0)
John(1)
Ruzie(5)
my AFKList is in Dialog.
CODE:
pawn Код:
CMD:afklist(playerid, params[])
{
new string[900];
new fstring[900];
new count = 0;
for(new slots = GetMaxPlayers(), i; i < slots; i++)
{
if (!IsPlayerConnected(i)) continue;
if(pData[i][pAFK] > 1)
{
count++;
format(fstring, 900, "%s (%d)\r\n\nTotal AFK Players: %d", GetpName(i), i, count);
strcat(string, fstring, 900);
ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");
}
}
if(count == 0) return ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", ""red"There is no current AFK Players!", "OK", "");
return 1;
}
Re: AFKList -
ReVo_ - 21.05.2012
Remove the \r\n and add ","
--
ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");
out from the "for"
--
pawn Код:
CMD:afklist(playerid, params[])
{
new string[900];
new fstring[900];
new count = 0;
for(new slots = GetMaxPlayers(), i; i < slots; i++)
{
if (!IsPlayerConnected(i)) continue;
if(pData[i][pAFK] > 1)
{
count++;
format(fstring, 900, "%s (%d), ", GetpName(i), i);
strcat(string, fstring, 900);
}
}
if(count == 0) return ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", ""red"There is no current AFK Players!", "OK", "");
else {
format(fstring, 900, "\r\nTotal AFK Players: %d", count);
strcat(string, fstring, 900);
ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");
}
return 1;
}
try this
Re: AFKList -
JaKe Elite - 21.05.2012
Thanks i will try