Raised This Month: $ Target: $400
 0% 

plugin improvement - anti name flood


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 02-17-2009 , 01:33   Re: plugin improvement - anti name flood
Reply With Quote #1

Whoa, I didn't know you can use 'goto' in Pawn. Ethier way, don't use tasks.
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "name flood" #define VERSION "0.1" #define AUTHOR "camper" new ct[33] new Float:g_LastTime[33] new nft public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     nft = register_cvar("amx_name_flood_time", "20"); } public client_putinserver(id) {     ct[id]=0;     g_LastTime[id] = 0.0 } public client_infochanged(id) {     static sNewName[33],sOldName[33]     get_user_info(id,"name",sNewName,32)     get_user_name(id,sOldName,32);             if(equal(sNewName,sOldName))         return PLUGIN_HANDLED;         new Float:Time = get_gametime();     switch(++ct[id])     {         case 3:         {             if(Time - g_LastTime[id] <= get_pcvar_float(nft))             {                 client_print(id, print_chat, "*** Nick change flood! Stop or you will be kicked! ***");                 client_print(id, print_chat, "*** Nick change flood! Stop or you will be kicked! ***");             }         }         case 4:         {             if(Time - g_LastTime[id] <= get_pcvar_float(nft))             {                 server_cmd("kick #%d ^"%s^"", get_user_userid(id), "Kicked due to name change flood.");                 ct[id] = 0             }         }     }     g_LastTime[id] = Time     return PLUGIN_CONTINUE }
__________________
Oh yeah

Last edited by Drak; 02-17-2009 at 19:02.
Drak is offline
Send a message via MSN to Drak
Reply



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 01:38.


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