SA-MP Forums Archive
[Tutorial] MINI-TUTORIAL: Using SetTimerEx with strings. - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] MINI-TUTORIAL: Using SetTimerEx with strings. (/showthread.php?tid=456032)



MINI-TUTORIAL: Passing parameters with SetTimer, works with strings. - Smokeyy - 04.08.2013

Hello, SA-MP Forums, i am new here. Today i'm gonna show you my method to use SetTimerEx with strings. SetTimerEx by default doesn't work with strings but there are a lot of methods. This is the tutorial, please correct me if i am wrong with something:
1. You get the function that you'r gonna use for SetTimerEx, and then put in in a public like that:
pawn Code:
forward MyFunction();
public MyFunction()
{
MyFunctionThatIUseWithSetTimerEx(parameters here);
}
2. You insert an SetTimer where you want that SetTimerEx to be just like that:
pawn Code:
// Somewhere in the gamemode.
SetTimer("MyFunction", 5000, 0);
3. That's all, i hope that tutorial is usefull for newbie's and again, please correct me if i am wrong with something.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - arjanforgames - 04.08.2013

You need to forward the MyFunction.
Good try though.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Smokeyy - 04.08.2013

Sorry, i forgot to forward it, i edited right now


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - arjanforgames - 04.08.2013

Also if you want to execute the MyFunction once you should use SetTimerEx right away instead if SetTimer. Correct me if you ment something else.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Konstantinos - 04.08.2013

You forgot the parentheses.
pawn Code:
forward MyFunction();
public MyFunction()
And I undestood nothing.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Smokeyy - 04.08.2013

Sorry for the missing things. I am very tired.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Sinner - 04.08.2013

Quote:

Using SetTimerEx with strings

You didn't use SetTimerEx and you didn't use strings.
Why the hell make a tutorial if you are not going to explain anything at all. Also, the point of SetTimerEx is to pass parameters, which you aren't doing anywhere.

Don't make tutorials anymore.

EDIT: To those who actually want to pass strings to a timer function, use y_timers.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Smokeyy - 04.08.2013

My friend, i wanted to mean that you can't use SetTimerEx with strings, and you can use that. Actually this is my first tutorial. And yes, the point of SetTimerEx is to pass parameters, you are right, i've used parameters of a function in the function named MyFunction. Take a closer look.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Smokeyy - 06.08.2013

Don't get me wrong, i mean't that you are able to insert an string in the random function 'MyFunctionThatIUseWithSetTimerEx'
Also, i created this tutorial because i had a function with strings in it and i wasn't able to use SetTimerEx. This worked for me.


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - newbienoob - 06.08.2013

SetTimerEx
Where's SetTimerEx in your tutorial?


Re: MINI-TUTORIAL: Using SetTimerEx with strings. - Y_Less - 06.08.2013

Quote:
Originally Posted by Smokeyy
Посмотреть сообщение
Don't get me wrong, i mean't that you are able to insert an string in the random function 'MyFunctionThatIUseWithSetTimerEx'
Also, i created this tutorial because i had a function with strings in it and i wasn't able to use SetTimerEx. This worked for me.
My point was that you claim this is a tutorial for passing strings, yet nowhere in the tutorial are there any actual STRINGS! That, to me, seems like the most essential part of a tutorial about strings...