Delay, Sleep, Pause???????
#1

I need some kind of delay or pause function to use in my script.

timer is not really what I want, I dont need a function run after the time is up, I just want the code below the pause line to continue on after the pause time is up.

Anyone know of any?
Reply
#2

TogglePlayerControllable
Reply
#3

Quote:
Originally Posted by WarriorEd22
Посмотреть сообщение
Totally not what I'm talking about.

I need something like this, in plain english

display textdraw
wait 4 seconds then continue<------ this is what I need
hide textdraw
Reply
#4

Somebody has created a function called "halt". I'm afaird this isn't what you're looking for, since it stops the thread, means it freezes the server for all players (multi-thread plugins' calculations will also run).

What you'd like to do is not possible without timers. I hate them too, but no other way. You can't just wait for a few seconds, even not in callbacks. This can be really annyoing, but this is the best you can do ATM.

pawn Код:
forward Continue(playerid);

function(){
    DoSomething  = 1;
    SetTimerEx("Continue",4000,false,"i",playerid);
    continue_label: new DoSomething = 3; //the continue of your function
    new DoSomething = 4;
}

public Continue() {
    DoSomething = 2;
    goto continue_label;
}
Although using labels in PAWN is not recommended, the code above should work.
Reply
#5

Quote:
Originally Posted by Reynolds
Посмотреть сообщение
Somebody has created a function called "halt". I'm afaird this isn't what you're looking for, since it stops the thread, means it freezes the server for all players (multi-thread plugins' calculations will also run).

What you'd like to do is not possible without timers. I hate them too, but no other way. You can't just wait for a few seconds, even not in callbacks. This can be really annyoing, but this is the best you can do ATM.

pawn Код:
forward Continue(playerid);

function(){
    DoSomething  = 1;
    SetTimerEx("Continue",4000,false,"i",playerid);
    continue_label: new DoSomething = 3; //the continue of your function
    new DoSomething = 4;
}

public Continue() {
    DoSomething = 2;
    goto continue_label;
}
Although using labels in PAWN is not recommended, the code above should work.
Thank you for letting me know. It sucks but oh well.

And Ill give that code a test later and see if it works. Looks very promising
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)