Raised This Month: $ Target: $400
 0% 

plugin performance


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
zimis
Junior Member
Join Date: Dec 2007
Location: Lithuania
Old 01-21-2009 , 09:05   plugin performance
Reply With Quote #1

Hi there

Few small questions about plugin performance

1) Which way is better?

PHP Code:
register_clcmd("say /command","sayCommand"


or


PHP Code:
register_clcmd("say","hook_say_and_search"


2) Why amxmodx default plugins check users access level twice?

in register_clcmd

i.e


PHP Code:
register_clcmd("say /command","sayCommand",ADMIN_KICK,"Whatever"
and then it check again in sayCommand()

i.e

PHP Code:
if (!cmd_access(id,level,cid,1)) 
    return 
PLUGIN_HANDLED 
3) Is it right to do?

PHP Code:
new plugon

public plugin_init(){
      
register_plugin("moo","moo","mooo")
      
plugon register_cvar("amx_whatever","1")
      switch(
plugon){
               case 
1:{
                       if 
plugon is 1 to register events,ham,command etc
               }
      }

__________________
I really like cookies

Last edited by zimis; 01-21-2009 at 09:07.
zimis is offline
Send a message via Skype™ to zimis
 



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:45.


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