Raised This Month: $ Target: $400
 0% 

MySQL client_aughorized lag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raa
Senior Member
Join Date: Oct 2005
Old 01-12-2007 , 23:17   Re: MySQL client_aughorized lag
Reply With Quote #1

SQLx huh...

Thats what I was afraid of.. I'm pretty dull already and struggled getting DBI to work. Every time I've sat down and went their the tutorial for SQLx I ended up running away with my tail between my legs... lol

I will definitely keep trying though.

I will also use client_putinserver as well.

One thing I was thinking that might be causing some of lag is the basic nature at which I'm determining the Ranks. (ie. If else if else if else, etc. bleh)

I started to try and adapt that function like so;

Code:
new PlayerRank[33]

new const rankNames[MAXRANKS][] = 
{ 
	"rank1",
	"rank2",
	"rank3",
	"rank4"
}

new const rankXP[MAXRANKS] = 
{
	0, 100, 150, 225
}

public plugin_init() 
{
 register_plugin("bleh", "0.1", "bleh")
}

public client_putinserver(id)
{ 
	set_task(HUD_INTERVAL, "ShowHUD", id)
	return PLUGIN_HANDLED
}

public ShowHUD(id)     
{  
	if(!is_user_connected(id))
		return 0
 
	static stats[8], hits[8], name[33]
	get_user_stats(id, stats, hits)
 	get_user_name(id, name, 32)
 
	new currentPlayerRank = 0;
	while(currentPlayerRank < (MAXRANKS - 1))
	{
		if(stats[0] >= rankXP[currentPlayerRank + 1])
			++currentPlayerRank;
		else
			break;
	}
	
	//code here
 
	return PLUGIN_HANDLED
}
But I then realized that that example I was working off of only had one prerequisite. While mine has two, "kills and headshots". And I couldn't figure out how to include that extra condition.

Anyway, does anyone think I should put any effort into adapting the above?
Or perhaps use CASE's instead of IF ELSE?

Would either of those even produce any noticeable optimization?
__________________
raa 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 22:25.


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