05.10.2013, 21:08
Looping through all players on -every- OnPlayerUpdate is a stupid thing to do, it will only cause stress on your server.
You should use foreach by ****** https://sampforum.blast.hk/showthread.php?tid=92679 which loops only through online players.
And remember that on foot, OnPlayerUpdate is called something like 6-8 times a second and in a car like 20-30 times.
Why not simply use Incognito's streamer and create an area? https://sampforum.blast.hk/showthread.php?tid=102865
This would mean you can use the callback OnPlayerEnterDynamicArea.
But if you don't want to rely on that, atleast whack it in a 5-10 second timer as you really don't need to be checking something as petty as that 30 times a second.
You should use foreach by ****** https://sampforum.blast.hk/showthread.php?tid=92679 which loops only through online players.
And remember that on foot, OnPlayerUpdate is called something like 6-8 times a second and in a car like 20-30 times.
Why not simply use Incognito's streamer and create an area? https://sampforum.blast.hk/showthread.php?tid=102865
This would mean you can use the callback OnPlayerEnterDynamicArea.
But if you don't want to rely on that, atleast whack it in a 5-10 second timer as you really don't need to be checking something as petty as that 30 times a second.