Raised This Month: $ Target: $400
 0% 

blocking using exec command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-13-2011 , 19:20   Re: blocking using exec command
Reply With Quote #3

It's useless anyway, if you want to block the flood, get that flood.cfg file and see what commands it abuses, and add flood control to them... meaning, they won't allow repeatitive usage in a short time, that can be EASILY done by adding a simple code before the function:

Code:
const g_fWaitTime = 3.0 // can't re-use something within 3 seconds


public spammyFunction(id)
{
    static Float:fGameTime
    static Float:fLastUsed[33]

    fGameTime = get_gametime()

    if(fLastUsed[id] < (fGameTime - g_fWaitTime))
        return PLUGIN_HANDLED // or whatever the function returns when cancelled

    fLastUsed[id] = fGameTime

    // the rest of the code...
}
__________________
Hunter-Digital is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode