Raised This Month: $ Target: $400
 0% 

Client Checker (1.0.1) [Update 02-25-2007] SQL Support


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-21-2006 , 09:26   Re: Client Checker
Reply With Quote #4

Some of your code is very repeticious..

ex:

in cc_messagetype, you use this like 3 times when you can simply put it above all three if() statements..

PHP Code:
new players get_playersnum()
for (
0;<= players;i++)
{
            if (
is_user_admin(i))
            {
                       
//Your client_prints
            
}

I would also suggest changing the if() statements in there to a switch() statement like so:

PHP Code:
    new players get_playersnum()
    for (
0;<= players;i++)

    switch(
type)
    {
        case 
0:
        {
            return 
PLUGIN_HANDLED;
        }
        
        case 
1:
        {
            if(
is_user_admin(i))
            {
                
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
            }
        }
        
        case 
2:
        {
            
client_print(idprint_chat"%d %s: %s %s"idname ,cvarvalue)
            if (
is_user_admin(i))
            {
                
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
            }
        }
        
        case 
3:
        {
            
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
        }
    } 
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
 



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 11:10.


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