SA-MP Forums Archive
How to use gettime to prevent 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: How to use gettime to prevent spamming? (/showthread.php?tid=630987)



How to use gettime to prevent spamming? - DuyDang2412 - 21.03.2017

Okay guys, I know that timer use much more memory, so I want to replace it by 'gettime', but the problem is I don't know how to use it. Something like the player /healme and then waiting for 10 seconds, the player can /healme again.


Re: How to use gettime to prevent spamming? - jlalt - 21.03.2017

PHP код:
new p_LastHealMe[MAX_PLAYERS]; // to save time in it 
PHP код:
CMD:healme(playeridparams[]) 
{
    if(( 
gettime() - p_LastHealMe[playerid] ) < 10)
    {
        
// error message
    
}
    else 
    {
        
// stuff
        
p_LastHealMe[playerid] = gettime();
    }




Re: How to use gettime to prevent spamming? - DuyDang2412 - 21.03.2017

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
new p_LastHealMe[MAX_PLAYERS]; // to save time in it 
PHP код:
CMD:healme(playeridparams[]) 
{
    if(( 
gettime() - p_LastHealMe[playerid] ) < 10)
    {
        
// error message
    
}
    else 
    {
        
// stuff
        
p_LastHealMe[playerid] = gettime();
    }

Thank you. Can I ask you about this?
I use
Quote:

for(new i = 0, j = GetPlayerMaxPoolSize(); i <= j; i++)

When it loops, my server is lag, and the logs say this:
Quote:

[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:05] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5745) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec
[13:50:06] [warning] client exceeded 'ackslimit' 127.0.0.1:63495 (5985) Limit: 5000/sec

So I get back to use foreach, can you explain this for me please?


Re: How to use gettime to prevent spamming? - jlalt - 22.03.2017

Can you show your codes under this loop? When you send a lot of data to player's game this would occur....


Re: How to use gettime to prevent spamming? - LetsOWN[PL] - 22.03.2017

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
new p_LastHealMe[MAX_PLAYERS]; // to save time in it 
PHP код:
CMD:healme(playeridparams[]) 
{
    if(( 
gettime() - p_LastHealMe[playerid] ) < 10)
    {
        
// error message
    
}
    else 
    {
        
// stuff
        
p_LastHealMe[playerid] = gettime();
    }

This can be yet more optimised, to avoid unnecessary maths.
pawn Код:
CMD:healme(playerid, params[]) {

    if(gettime() > p_LastHealMe[playerid]) {

        // Stuff
       
        p_LastHealMe[playerid] = gettime() + timeBetweenCalls;
    } else {

                // Error
        }
}
Back on topic.

As for
pawn Код:
for(new i = 0, j = GetPlayerMaxPoolSize(); i <= j; i++)
The loop itself's fine, please show us it's body.



Re: How to use gettime to prevent spamming? - Kraeror - 22.03.2017

Try this :
Quote:

new timeforheal = 1;
CMD:healme(playerid, params[])
{
if(timeforheal == 1)
{
//your code here
SetTimerEx("HealAgain",10000, false, "i", playerid);
timeforheal = 0;
}
else SendClientMessage(playerid,/*your color*/,"The error message!");
return 1;
}
forward HealAgain(playerid);
public HealAgain(playerid)
{
timeforheal = 1;
}




Re: How to use gettime to prevent spamming? - OneDay - 22.03.2017

gettime is like GetTickCount and is lot better than SetTimerEx


Re: How to use gettime to prevent spamming? - DuyDang2412 - 23.03.2017

My code is just this.
PHP код:
for(new 0GetPlayerMaxPoolSize(); <= ji++){
    if(
Character[i][Admin] > 0System_Scm(istringTYPE_NOTICE);

And my problem has been solved, I changed
Quote:

GetPlayerMaxPoolSize()

to
Quote:

GetPlayerPoolSize()

And I don't know if GetPlayerPoolSize or Foreach is better than?


Re: How to use gettime to prevent spamming? - Sew_Sumi - 23.03.2017

Foreach should be better.


Where did you find GetPlayerMaxPoolSize? That's not even on the wiki, and GetPlayerPoolSize seems to be what you should be using.


Re: How to use gettime to prevent spamming? - DuyDang2412 - 24.03.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Foreach should be better.


Where did you find GetPlayerMaxPoolSize? That's not even on the wiki, and GetPlayerPoolSize seems to be what you should be using.
And I don't know, but maybe GetPlayerMaxPoolSize is a hidden function because it was defined. By the way, thank you for the help.