Raised This Month: $ Target: $400
 0% 

scripting help:anti-Flood for my plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-14-2007 , 09:40   Re: scripting help:anti-Flood for my plugin
Reply With Quote #10

Quote:
Originally Posted by Salepate View Post
if you put ADMIN_SLAY you don't need to use cmd_access();
is it wrong ?

besides you wrote
Code:
if ( ! cmd_access(id, level, cid, 0) )


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.
No, that's the amount of args, but it will never work. I don't know why he used cmd_access, just use this:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define ACCESS ADMIN_SLAY new Float:g_LastRestart[33] 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[id] < 10.0)         return         g_LastRestart[id] = Time         server_cmd("sv_restart 1") }

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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