Weird issue when player joins
Okay, when player joins my server, the function Load_MySql(id); load his data.
When that happen, players who are in the game already can't use /rank command anymore to see their rank. PHP Code:
|
Re: Weird issue when player joins
Hi Gasman, is your plugin hitting an error? This would cause it to stop working.
|
Re: Weird issue when player joins
No, nothing in logs. That's why it is so weird, I don't know what could possibly cause that.
|
Re: Weird issue when player joins
You are not showing all code, we cannot see where Load_MySql is called.
|
Re: Weird issue when player joins
It's called at client_authorized(id) and the only function that sits there is Load_MySql(id)
EDIT: FIXED! Can't after 2 days of trying, can't believe how silly issue it was. Basically, the solutin is below: PHP Code:
PHP Code:
|
Re: Weird issue when player joins
new Data[ 1 ] would result in sizeof(Data) = 1
So the fact that it's now working is coincidental. Do you possibly have Data also defined globally, and the plugin is using the wrong variable? |
Re: Weird issue when player joins
In some cases I had new Data[2], in the other I had new Data[1] so I think that was the issue and the reason why I had this problem.
Btw, I was too lazy to search Data size in every function so that's the reason why I put sizeof(Data) everywhere. |
Re: Weird issue when player joins
Quote:
|
Re: Weird issue when player joins
Quote:
So for example: PHP Code:
|
Re: Weird issue when player joins
Just use sizeof() in all those functions. There's a reason why this function got introduced. There's no need for you to go look for the correct size. Whatever size u give the array, sizeof() will always get the correct size, no matter where your array got declared.
|
| All times are GMT -4. The time now is 20:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.