Question about SetTimer(Ex)
#1

I was wondering, do I need a loop when using SetTimer, like for a ping check system? or is all cases?
And for SetTimerEx called on 'OnPlayerConnect', is there a need for a loop?

And the last question, in any case, Is it better to use SetTimer or SetTimerEx?, should I use SetTimerEx when it's possible?

The last question is regarding an anti-cheat.

I would appreciate a reply, from someone who actually understands this.
Reply
#2

Using SetTimerEx or SetTimer is depends on your case, it's totaly different, take it like Kick and Ban.
Both do the same but they have not the same format.
Reply
#3

Ergh, this is exactly what the wiki is for - checking the function descriptions would have told you everything you need to know.

SetTimer() calls a function without specifiying the parameter values for that function. If there are any parameters for that function, they will all be set to 0.

SetTimerEx() calls a function the same way that SetTimer() does, but you can specify the values for the functions.

Here's an example:
pawn Код:
public MyFunction(param1, Float:param2)
{
  printf("%d, %.2f", param1, param2);
  return 1;
}

//---------------------------------------

SetTimer("MyFunction", 1000, 0); // The output from MyFunction() with this method will be: 0, 0.00

SetTimerEx("MyFunction", 1000, 0, "df", 10, 17.85); // The output from MyFunction() with this method will be: 10, 17.85

//---------------------------------------

forward MyFunction(param1, Float:param2); // Just so nobody whinges >.>
I hope this clears it up for you - SetTimerEx() is for setting parameters, SetTimer() will set them to 0 for you if there are any, or if not, it won't use any.

~Cueball~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)