scripting help:anti-Flood for my plugin
lets say...
////////////////////////// bla2~ public plugin_init() { register_clcmd("say /restart","recmd") } public recmd() { server_cmd("sv_restart 1") } //////////////////////////// When the client say /restart,the server will sv_restart 1. If he say /restart again right after that,the server will not sv_restart 1, as he need to wait for 10 sec before saying /restart again. I want to prevent flooding. How to make the plugin works like this? any1 who is generous enough pls help. tq in adv |
Re: scripting help:anti-Flood for my plugin
Here is how that would look:
Code:
|
Re: scripting help:anti-Flood for my plugin
Absolutely abhorrid.
Code:
Much more resource efficient. |
Re: scripting help:anti-Flood for my plugin
Thanks for that hawk, I actually was actually curious about how to use halflife_time() correctly.
|
Re: scripting help:anti-Flood for my plugin
can make it work only for admin with flag "e" ? thx. :)
|
Re: scripting help:anti-Flood for my plugin
Code:
Here is it. You should take a look in other plugins source to see how it works, or just watch includes or the wiki. |
Re: scripting help:anti-Flood for my plugin
Code:
|
Re: scripting help:anti-Flood for my plugin
thx..Black rose..:up: +karma
|
Re: scripting help:anti-Flood for my plugin
if you put ADMIN_SLAY you don't need to use cmd_access();
is it wrong ? besides you wrote Code:
isn't 0 supposed to be ADMIN_ALL ? and if it's the case then none of the players (Admin included) can use the command. Tell me if I am wrong. |
Re: scripting help:anti-Flood for my plugin
Quote:
Code:
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. |
| All times are GMT -4. The time now is 22:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.