Raised This Month: $ Target: $400
 0% 

scripting help:anti-Flood for my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-14-2007 , 12:30   Re: scripting help:anti-Flood for my plugin
Reply With Quote #1

Quote:
Originally Posted by Hawk552 View Post
Also, please don't screw with the indentation and put your own when you're adding 1 line. Not only does K&R look worse, it's just stupid to make changes like that.
1. Your ( and almost every1 elses ) identation looks like shit.
2. Don't tell me what to do, you're not even close being any superior of me.
3. I can do whatever I want with your code... it's open source.
4. There's nothing stupid doing it.
[ --<-@ ] Black Rose is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-14-2007 , 13:21   Re: scripting help:anti-Flood for my plugin
Reply With Quote #2

I'm not even going to bother rebutting that, it's just so laughable.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
stupok
Veteran Member
Join Date: Feb 2006
Old 01-14-2007 , 16:47   Re: scripting help:anti-Flood for my plugin
Reply With Quote #3

To do that, you would use only one variable for all admins to "share" instead of each admin having his own variable.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define ACCESS ADMIN_SLAY new Float:g_LastRestart public plugin_init() {     register_plugin("Restart","1.0","Hawk552")     register_clcmd("say /restart","say_restart",ACCESS) } public say_restart(id) {     if(!(get_user_flags(id) & ACCESS))         return         new Float:Time = halflife_time()     if(Time - g_LastRestart < 10.0)         return         g_LastRestart = Time         server_cmd("sv_restart 1") }
stupok is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 01-14-2007 , 11:26   Re: scripting help:anti-Flood for my plugin
Reply With Quote #4

Solved Thanks Hawk....

Last edited by Alka; 01-14-2007 at 11:33.
Alka is offline
drcopy_wawe
Junior Member
Join Date: Dec 2006
Old 01-14-2007 , 16:13   Re: scripting help:anti-Flood for my plugin
Reply With Quote #5

tq stupok, hawk n blackrose for sharing this.

but this anti-flood is only preventing flood individually.
what i mean is if all 10 players in the server just being so stupid at the same time and all of them say /restart, absolutely there will be 10 round restarts.
still flooding the server.how to solve this?

Last edited by drcopy_wawe; 01-14-2007 at 16:35.
drcopy_wawe is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-14-2007 , 16:54   Re: scripting help:anti-Flood for my plugin
Reply With Quote #6

You can use get_gametime() instead of halflife_time() also. So you don't need to do #include <engine>.

They are the same native but one is in the core and the other is in the engine module.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-14-2007 , 17:11   Re: scripting help:anti-Flood for my plugin
Reply With Quote #7

Also, this do nothing. Remove "ACCESS".
Code:
register_clcmd("say /restart","say_restart",ACCESS)
[ --<-@ ] Black Rose is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-14-2007 , 17:12   Re: scripting help:anti-Flood for my plugin
Reply With Quote #8

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
Also, this do nothing. Remove "ACCESS".
Code:
register_clcmd("say /restart","say_restart",ACCESS)
Actually, you're wrong. If it's there, it won't appear in amx_help to people that don't have access to it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-14-2007 , 17:14   Re: scripting help:anti-Flood for my plugin
Reply With Quote #9

ok
[ --<-@ ] Black Rose is offline
drcopy_wawe
Junior Member
Join Date: Dec 2006
Old 01-14-2007 , 18:03   Re: scripting help:anti-Flood for my plugin
Reply With Quote #10

lol that easy
thanx stupok69
+1 karma for u
drcopy_wawe is offline
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 22:28.


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