[Tutorial] MINI-TUTORIAL: Using SetTimerEx with strings.
#1

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.
Reply
#2

You need to forward the MyFunction.
Good try though.
Reply
#3

Sorry, i forgot to forward it, i edited right now
Reply
#4

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.
Reply
#5

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

Sorry for the missing things. I am very tired.
Reply
#7

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.
Reply
#8

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.
Reply
#9

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.
Reply
#10

SetTimerEx
Where's SetTimerEx in your tutorial?
Reply
#11

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)