24.02.2009, 12:59
Just a little question, do you know a function which will allow a break between to things?
Here is an exemple
I found this on the wiki:
But when I use it it freezes all, not only the command
For example, if I type /me is hungry duing the halt time it will only appear at the eand of this time... I althouhg think that it freezes the whole script..
So any help please?
Thanks in advance
Here is an exemple
pawn Код:
if(strcmp(cmd, "/break", true) == 0)
{
GameTextForPlayer(playerid, "Hey, sending you a message at the end of this one", 5000, 3);
break(5); //what I need, here it would make a break of 5 seconds and then continue the code below
GameTextForPlayer(playerid, "Well 5 seconds have passed!", 5000, 3);
//...
}
pawn Код:
halt(seconds)
{
new _newTime[4], _oldTime[4];
gettime(_oldTime[0], _oldTime[1], _oldTime[2]);
_oldTime[3] = _oldTime[2] + (_oldTime[1] * 60) + (_oldTime[0] * 600);
while(_newTime[3] != (_oldTime[3] + seconds))
{
gettime(_newTime[0], _newTime[1], _newTime[2]);
_newTime[3] = _newTime[2] + (_newTime[1] * 60) + (_newTime[0] * 600);
}
}
For example, if I type /me is hungry duing the halt time it will only appear at the eand of this time... I althouhg think that it freezes the whole script..
So any help please?
Thanks in advance