SA-MP Forums Archive
One question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: One question (/showthread.php?tid=501921)



One question - Tadas - 21.03.2014

Hello, I have a question. Is SetTimer and SetTimerEx is the same?


Re: One question - BizzyD - 21.03.2014

SetTimer
SetTimerEx

Read them.


Re: One question - Hanuman - 21.03.2014

NO, SetTimer is for All
But SetTimerEx is only for a individual player


Re: One question - RajatPawar - 21.03.2014

Quote:
Originally Posted by Hanuman
Посмотреть сообщение
NO, SetTimer is for All
But SetTimerEx is only for a individual player
Wrong!

--------------------------------------------------

Nope, if they were the same, why would they exist as two different natives?

SetTimer - you can execute a function with NO arguments with this.
SetTimerEx - you can execute a function with arguments you HAVE passed.

Example -
pawn Код:
noArgs()
{
    printf("No arguments.");
}

oneArg( number )
{
   printf(" Number: %d", number);
}

public OnGameModeInit()
{
     SetTimer("noArgs", 1000, false);
     SetTimerEx("oneArg", 1000, false, "i", 5);
     // i specifier tells that we are passing an integer.
     return 1;
}
Output -
pawn Код:
No arguments.
Number: 5
Read about specifiers here.


Re: One question - Hanuman - 21.03.2014

Well, I never checked the samp wiki becuase i never got any problem with timer!
So i told him wht i think


Re: One question - Tadas - 21.03.2014

BIG Thanks to all