Raised This Month: $ Target: $400
 0% 

blocking using exec command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 06-13-2011 , 14:06   blocking using exec command
Reply With Quote #1

how can i block using the "exec [file]" command
like if somone use in console "exec flood.cfg"
or something
Dr7sTyLe is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2011 , 18:47   Re: blocking using exec command
Reply With Quote #2

"exec" is a client command that is never sent to the server (i.e. it's not possible to block it with a plugin).
__________________
fysiks is online now
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
Reply


Thread Tools
Display Modes

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