31.10.2010, 03:15
Basically I want the following code to work without having to use " SetTimer() as the delay. Is there another way to use delays to pause code from executing but remain inside the same function?
So something like :
I find it hard to believe you can't pause code contained inside of a function doing something like :
If anyone knows an alternative method to using the SetTimer() please let me know as I've tried searching for the words Delay and Timer and Time Delay and can't find anything. I really thought this would be simple to find.
AFAIK using wait() will stop the global code .. aka.. EVERYTHING and not just the local code if i'm wrong then an example of how to get what i need to work would be sooooo appreciated. this is kinda my last shot at finding a way.
Код:
{ SendClientMessage(playerid, 0xF1CB45FF, "Beginning Operation"); SetPlayerPos(playerid, 268.5968,1857.6873,9.8133); // Operating Table ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_in",4.0,1,1,1,1,1); SetTimer("OperateDelay", 10000, true); ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_out",4.0,1,1,1,1,1); }
Код:
{ SendClientMessage(playerid, 0xF1CB45FF, "Beginning Operation"); SetPlayerPos(playerid, 268.5968,1857.6873,9.8133); // Operating Table ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_in",4.0,1,1,1,1,1); Delay(10000); ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_out",4.0,1,1,1,1,1); }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/operate", cmdtext, true, 10) == 0) { SendClientMessage(playerid, 0xF1CB45FF, "Beginning Operation"); SetPlayerPos(playerid, 268.5968,1857.6873,9.8133); // Operating Table ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_in",4.0,1,1,1,1,1); Delay(10000); ApplyAnimation(playerid,"SUNBATHE ","Lay_Bac_out",4.0,1,1,1,1,1); SetPlayerHealth(playerid,100); SendClientMessage(playerid, 0xF1CB45FF, "You're all Patched Up!!"); return 1; } return 0; }
AFAIK using wait() will stop the global code .. aka.. EVERYTHING and not just the local code if i'm wrong then an example of how to get what i need to work would be sooooo appreciated. this is kinda my last shot at finding a way.