hello,
I want to create pre-made functions that i will use again and again inside my script file. For example, i want to create the function WaitOneSec(which will obviously permit me to place a timer of 1 second wherever i want), and then WaitTwoSec, WaitThreeSec etc..
The problem is that i am not sure how to put it, because AddTimer demands a function as parameter. Should i do it like that :
void WaitOneSec(string& asFunction)
{
AddTimer("", 1.0f, asFunction);
}
and then in my main code, whenever i want to add a timer before a function, i would do the following(for example wait 1 sec then kill player) :
WaitOneSec("KillPlayer");
This is assuming 1.0f is equal to one second.
What do you think ?
EDit :
Also, is it possible to insert a function inside another function as parameter with this scripting language, like this :
AddEntityCollideCallback("Player", "AreaChairFly", AddPropImpulse("MyChair", 0.0, 7, 0.0, "world"), false, 0);
Thanks!