Getting the instruction return in brackets - 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: Getting the instruction return in brackets (
/showthread.php?tid=532981)
Getting the instruction return in brackets -
S4t3K - 21.08.2014
Hi.
I was kinda bored today so I decided to challenge myself in something pretty hard.
It will be most likely useless but all I want is to know how to do.
The point is simple : I create an array, I put it as parameter of a function called "store", and in this function, I will put some function which return a number (float or integer). Each number returned will fill the lowest empty cell of the array.
If it's still blur to you, read this small code :
pawn Код:
new array[3];
forward myCallback();
store(array)
{
strval("2048"); // will return 2048
CreateObject(18, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0); // will most likely return 0
SetTimer("myCallback", 1500, false); // will return a timerid
}
So the point would be to store 2048 in the cell 0 of the array, 0 in the cell 1 and the timerid in the cell 2.
Question : how to catch the returned values by the instructions between brackets ? I know ****** did it in y_inline, but I'm just interested in "how".
Thanks to the persons who'll be able to answer me.
PS : I know I'll most likely have to use #emit but this is a very large domain and thus telling me "using #emit" would just be a vague answer.