Raised This Month: $12 Target: $400
 3% 

Make script better. "Just Joined"


Post New Thread Reply   
 
Thread Tools Display Modes
xOscar
BANNED
Join Date: Nov 2012
Old 11-23-2012 , 17:58   Re: Make script better. "Just Joined"
Reply With Quote #31

Okay, why?
xOscar is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-24-2012 , 04:56   Re: Make script better. "Just Joined"
Reply With Quote #32

It is not, he creates a 32 cell array 4 times even though it's not really needed, since as it's already been said, IP cannot exceed 15 characters. Also, I don't see a reason why does he even create the array 4x if he uses only 3 fields of it. Just do it like this

PHP Code:
#include < amxmodx >
#include < amxmisc >

#define PLUGIN "justJoined"
#define VERSION "0.1"

public plugin_init()
    
register_plugin(PLUGINVERSION"Blend")

public 
client_putinserver(id)
{
    new 
szIp15 ], szAuthid34 ], szName33 ]
    
    
get_user_ipidszIpcharsmaxszIp ), true )
    
get_user_authididszAuthidcharsmaxszAuthid ) )
    
get_user_nameidszNamecharsmaxszName ) )
    
    
    
server_print("] Name: %s [%s]^n] SteamID: %s^n] IP: %s"szNameis_user_admin(id) ? "ADMIN" "USER"szAuthidszIp);

This is pretty much the best way of doing what you want, there's nothing more to optimize.
Backstabnoob is offline
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 13:58.


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