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?
__________________