Alternative implementation of "wait".
#5

Quote:
Originally Posted by Y_Less
View Post
That is a good solution when it works, but if you have local variables it will fail:

pawn Code:
public OnGameModeInit()
{
    new a = 42;
    print("1");
    Wait(1000)<x>
    printf("2 %d", a); // Error.
    return 1;
}
But there is even the possibility to use SetTimerEx
Code:
#define Wait(%0)<%1,%2,%3> return SetTimerEx("@wait_"#%1,%0,false,%2,%3); } \
					forward @wait_%1(%3); @wait_%1(%3) {
but the only problem of this method is that you can't use strings
Reply


Messages In This Thread
Alternative implementation of "wait". - by Emmet_ - 02.01.2014, 11:59
Re: Alternative implementation of "wait". - by Patrick - 02.01.2014, 12:07
Re: Alternative implementation of "wait". - by Emmet_ - 02.01.2014, 17:18
Re: Alternative implementation of "wait". - by IPrototypeI - 02.01.2014, 18:08
Re: Alternative implementation of "wait". - by IPrototypeI - 02.01.2014, 19:03
Re: Alternative implementation of "wait". - by Emmet_ - 02.01.2014, 19:11
Re: Alternative implementation of "wait". - by IPrototypeI - 02.01.2014, 19:22
Re: Alternative implementation of "wait". - by Emmet_ - 02.01.2014, 19:38

Forum Jump:


Users browsing this thread: 2 Guest(s)