About timers
#1

Hello, I was just wondering if anyone of you could explain if I should use SetTimer or SetTimerEx and why? I am making a death system and later on a level system but I want the method that gives the least lag.. And under which callback should I put it or should it exist in the timers callback?
Reply
#2

It depends on your situation. Usually you use timers to check something periodically, but you don't want to put it in OnPlayerUpdate, or to delay some action.
Reply
#3

Well my death system works like this: When the player dies the position is saved and a variable named pDeath is set to 1. Then OnPlayerSpawn the player will spawn on the death place if pDeath is 1. Then I want a timer to count down to 0 so that the player respawns. Should the timer be started when the player dies or should it always be going, checking if any players pDeath is 1?
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
They are exactly the same in terms of use - just the latter one has more parameters. As for "lag", you can't possibly be concerned that the code is slow because you haven't even written it yet!
I don't want you to write the whole script for me, but could you breifly explain how you would do this? I mean, so that I can learn right form the beginning.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)