Update player statistics with database stats -
DBan - 10.11.2012
Hello all, I'm trying to make a function to update player statistics in-game by getting statistics from a mysql database. The problem is that if the player's in-game admin level is 0, then it will go through the if statement. If it is any number other than 0, then it won't go through the if statement.
The code below supposed to check if the player's admin level is the same as the one inside the database, if it isn't then it would correct the player's admin level in-game to match the database's admin level.
Here's my code.
I would appreciate all the help I can get.
Thanks.
-DBan
Re: Update player statistics with database stats -
ReneG - 10.11.2012
What exactly are you trying to accomplish? Are you just trying to load the data into the player's variable, or are you trying to do something else?
Re: Update player statistics with database stats -
DBan - 10.11.2012
Quote:
Originally Posted by VincentDunn
What exactly are you trying to accomplish? Are you just trying to load the data into the player's variable, or are you trying to do something else?
|
Getting data from the MySQL database, and then load it into the player's variables.
However, I am trying to make it so that it will not do it unless the player's variables
do not match the field inside the database.
Re: Update player statistics with database stats -
SuperViper - 10.11.2012
pawn Код:
if(!strcmp(save, PlayerInfo[playerid][adminlevel]))
should be
pawn Код:
if(strval(save) != PlayerInfo[playerid][adminlevel])
assuming that
PlayerInfo[playerid][adminlevel] is an integer.
Re: Update player statistics with database stats -
DBan - 10.11.2012
Quote:
Originally Posted by SuperViper
pawn Код:
if(!strcmp(save, PlayerInfo[playerid][adminlevel]))
should be
pawn Код:
if(strval(save) != PlayerInfo[playerid][adminlevel])
assuming that PlayerInfo[playerid][adminlevel] is an integer.
|
Meh, i've tried that but accidentally left it as this:
pawn Код:
if(strval(save) != PlayerInfo[playerid][adminlevel]))
So, I just assumed it didn't work.
Anyways, now it works. Tyvm.
Re: Update player statistics with database stats -
Alinaqi115 - 06.04.2017
Brother I DOnt Know how i chagne please reply