Raised This Month: $ Target: $400
 0% 

How to make function to block spam commands SOLVED


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-21-2010 , 16:04   Re: How to make function to block spam commands SOLVED
Reply With Quote #6

Used this for ages, works like a charm.
Code:
new Float:g_flLastCmd[ 33 ]; public AnyCommand( id ) {     if( CheckFlood( id ) )         return PLUGIN_HANDLED;         // your code } bool:CheckFlood( const id ) {     new Float:flGametime = get_gametime( );         if( g_flLastCmd[ id ] < flGametime ) {         g_flLastCmd[ id ] = flGametime + 0.15;                 return false;     }         return true; }
__________________
xPaw 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 11:19.


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