Breaktime
#1

Just a little question, do you know a function which will allow a break between to things?
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);
    //...
}
I found this on the wiki:
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);
    }
}
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
Reply


Messages In This Thread
Breaktime - by Coicatak - 24.02.2009, 12:59
Re: Breaktime - by Mikep - 24.02.2009, 13:11
Re: Breaktime - by Coicatak - 24.02.2009, 14:19
Re: Breaktime - by Mikep - 24.02.2009, 14:21
Re: Breaktime - by Coicatak - 24.02.2009, 14:23
Re: Breaktime - by Mikep - 24.02.2009, 14:30
Re: Breaktime - by Coicatak - 24.02.2009, 14:43
Re: Breaktime - by Coicatak - 26.02.2009, 21:38
Re: Breaktime - by Streetplaya - 26.02.2009, 21:44
Re: Breaktime - by Coicatak - 26.02.2009, 21:53

Forum Jump:


Users browsing this thread: 1 Guest(s)