18.10.2011, 02:32
I'm making an FPS list to where it displays all the FPS of all the players. I tested it and everytime i press the command "/fpslist" it displays the players. But once I close it and I type it again, it displays the same thing, twice.
Ex.
1 player typed /fpslist and it says
Player: 46
He closes and types it again and it says:
Player: 46
Player: 46
He then closes and types it a third time and it says:
Player: 46
Player: 46
Player: 46
It just continues to post it over and over.
Ex.
1 player typed /fpslist and it says
Player: 46
He closes and types it again and it says:
Player: 46
Player: 46
He then closes and types it a third time and it says:
Player: 46
Player: 46
Player: 46
It just continues to post it over and over.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fpslist", cmdtext, true, 10) == 0)
{
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
format(FPSList, sizeof(FPSList), "%s%s: %d\n", FPSList, pName(i), FPS2[i]-1);
ShowPlayerDialog(playerid, DIALOG_FPS_LIST, DIALOG_STYLE_MSGBOX, "Players FPS", FPSList, "Ok", "");
}
}
return 1;
}
return 0;
}