18.10.2011, 22:26
The results I have is:
if (pInfo[playerid][pConnected]) {} executed 41.62 times/ms.
if (IsPlayerConnected(playerid)) {} executed 29.71 times/ms.
I couldn't think of a simple way in PAWN to only count and check actual people online in a loop without constantly re-assigning their ID's (which would be annoying), so I thought what if I just used a simple value in the player enumeration to track it (on in onplayerconnect and off in onplayerdisconnect) and loop through the whole lot as you normally would, and it's faster .
It's a very handy tool you made!!!
if (pInfo[playerid][pConnected]) {} executed 41.62 times/ms.
if (IsPlayerConnected(playerid)) {} executed 29.71 times/ms.
I couldn't think of a simple way in PAWN to only count and check actual people online in a loop without constantly re-assigning their ID's (which would be annoying), so I thought what if I just used a simple value in the player enumeration to track it (on in onplayerconnect and off in onplayerdisconnect) and loop through the whole lot as you normally would, and it's faster .
It's a very handy tool you made!!!