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

Country Nick


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-16-2011 , 16:17   Re: Country Nick
Reply With Quote #11

You should only use geoip_code2_ex() once. Twice is inefficient and pointless.
__________________
fysiks is online now
.MMYTH.
BANNED
Join Date: Sep 2010
Location: Brasil - RS
Old 01-16-2011 , 16:24   Re: Country Nick
Reply With Quote #12

check once at putinserver with [id] ?
.MMYTH. is offline
Send a message via MSN to .MMYTH.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-16-2011 , 16:30   Re: Country Nick
Reply With Quote #13

Quote:
Originally Posted by .MMYTH. View Post
check once at putinserver with [id] ?
What do you think? If you don't know you should test it. You are doing the exact same thing twice.
__________________

Last edited by fysiks; 01-16-2011 at 16:34.
fysiks is online now
.MMYTH.
BANNED
Join Date: Sep 2010
Location: Brasil - RS
Old 01-25-2011 , 18:01   Re: Country Nick
Reply With Quote #14

New version v1.5
.MMYTH. is offline
Send a message via MSN to .MMYTH.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2011 , 18:57   Re: Country Nick
Reply With Quote #15

You need to stop using one function several times for no reason. That being said, you already cache the player's country so you should use that.

Also, I would do playernation[id][0] = 0 at the begining of client_putinserver(id).
__________________
fysiks is online now
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-25-2011 , 20:04   Re: Country Nick
Reply With Quote #16

Exactly what fysiks said, but just to add to it and make it more clear:

Stop using the if statements that use the geoip_code2_ex as the check, and instead do the command before the if, and then just use if( playernation[id] ), that way you only use 1 call to geoip_code2_ex.

ANd like fysiks said, you already put the nation in playernation[33], so you don't have to keep calling geoip_code2_ex in client_infochanged.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2011 , 20:36   Re: Country Nick
Reply With Quote #17

Quote:
Originally Posted by nikhilgupta345 View Post
Exactly what fysiks said, but just to add to it and make it more clear:

Stop using the if statements that use the geoip_code2_ex as the check, and instead do the command before the if, and then just use if( playernation[id] ), that way you only use 1 call to geoip_code2_ex.

ANd like fysiks said, you already put the nation in playernation[33], so you don't have to keep calling geoip_code2_ex in client_infochanged.
Code:
if( playernation[id] )


Code:
if( playernation[id][0] )
__________________
fysiks is online now
.MMYTH.
BANNED
Join Date: Sep 2010
Location: Brasil - RS
Old 02-08-2011 , 16:32   Re: Country Nick
Reply With Quote #18

I test and the [id][0] bug's.
.MMYTH. is offline
Send a message via MSN to .MMYTH.
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 02-08-2011 , 16:44   Re: Country Nick
Reply With Quote #19

Then you need to clear the user's array on disconnect.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-08-2011 , 18:26   Re: Country Nick
Reply With Quote #20

Quote:
Originally Posted by .MMYTH. View Post
I test and the [id][0] bug's.
Not possible if you did it correctly. Show the new code.

Also, when you say it "bugs" you need tell us what you mean. It doesn't help at all when you are extremely vague.
__________________
fysiks is online now
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 19:57.


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