SA-MP Forums Archive
Please wait before using this command* - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please wait before using this command* (/showthread.php?tid=482345)



Please wait before using this command* - Anak - 20.12.2013

Hello guys....
i am using tickcounts for pausing cmd to use again...
but when i upload that script to volt-host ... i always get that "please wait before using this command"
but in home host all working perfect...

+ i don't want to use many timers... cuz of lag... any other way or fix .. please thanks


Re: Please wait before using this command* - Vince - 20.12.2013

Tickcount overflows if the server (physical box, not SA-MP server) has been up for a long time without restart. Try using gettime() instead.


Re: Please wait before using this command* - Anak - 20.12.2013

any example simple?


Re: Please wait before using this command* - Patrick - 20.12.2013

Quote:
Originally Posted by Anak
Посмотреть сообщение
any example simple?
Sure, Explanation inside

pawn Код:
CMD:delaytime(playerid, params[])
{//opening bracket
    static DelayTimer[MAX_PLAYERS]; //local or static variable, only for this function

    if(gettime() - DelayTimer[playerid] >= 1) //equals or more than 1
        return SendClientMessage(playerid, -1, "Error Message");//shows the error

    DelayTimer[playerid] = gettime() + 10; //get the server time and adds +10 seconds restriction.
    return true; // returns 1 or true
} // closing bracket



Re: Please wait before using this command* - Anak - 20.12.2013

ahh.. that's pretty easy .. thanks both


Re: Please wait before using this command* - Anak - 20.12.2013

ahh.. that's pretty easy .. thanks both


Re: Please wait before using this command* - Anak - 24.12.2013

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Sure, Explanation inside

pawn Код:
CMD:delaytime(playerid, params[])
{//opening bracket
    static DelayTimer[MAX_PLAYERS]; //local or static variable, only for this function

    if(gettime() - DelayTimer[playerid] >= 1) //equals or more than 1
        return SendClientMessage(playerid, -1, "Error Message");//shows the error

    DelayTimer[playerid] = gettime() + 10; //get the server time and adds +10 seconds restriction.
    return true; // returns 1 or true
} // closing bracket
i always get "Error Message" please help


Re: Please wait before using this command* - BiGR0ckeR - 24.12.2013

Quote:
Originally Posted by Anak
Посмотреть сообщение
i always get "Error Message" please help
I think you should delete the gm from the ftp and then put that script in the pawno and reupload it Try it , It will work i think!


Re: Please wait before using this command* - Konstantinos - 24.12.2013

http://forum.sa-mp.com/showthread.ph...57#post1959757