Raised This Month: $ Target: $400
 0% 

plugin performance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-21-2009 , 12:20   Re: plugin performance
Reply With Quote #1

1. If I have more than 1 say command in my plugin, then I hook "say" and check the command.
Otherwise, I just register the 1 command.

2. Just setting the flag in register_*cmd() doesn't enforce the flag.
You have to enforce it yourself with cmd_access(), access(), or (get_user_flags() & ADMIN_*).

3. I think it would be best if you registered the events anyway, then checked to see if the cvar was enabled or disabled when they were called.

Code:
new cvar_on; public plugin_init() {     register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");         cvar_on = register_cvar("plugin_on", "1"); } public EventNewRound() {     if( !get_pcvar_num(plugin_on) ) return;         // code if plugin is on }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-21-2009 , 14:46   Re: plugin performance
Reply With Quote #2

Quote:
Originally Posted by Exolent[jNr] View Post
3. I think it would be best if you registered the events anyway, then checked to see if the cvar was enabled or disabled when they were called.
This way you can enable the plugin without having to change maps/restart server.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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:44.


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