SA-MP Forums Archive
Spamming - 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: Spamming (/showthread.php?tid=446861)



Spamming - thefatshizms - 27.06.2013

I have this function:

pawn Код:
IsPlayerSpamming(playerid)
{
    if((tickcount() - Time[playerid])  > 1800) {
        Time[playerid] = tickcount();
        return 1;
    } else return 0;
}
Works perfectly fine on localhost but when i run the gamemode on my vps thats been up for a while (a few days) it says that I'm always spamming.


Re: Spamming - Jefff - 28.06.2013

https://sampwiki.blast.hk/wiki/GetTickCount


Respuesta: Spamming - JustBored - 28.06.2013

You have to use gettime()


Re: Spamming - dEcooR - 28.06.2013

try this

Код:
IsPlayerSpamming(playerid)
{
    if(gettime() + Time[playerid])  > 1800)
    {
        Time[playerid] = gettime(); 
        return 1;
    } 
    else return 0;
}