11.10.2010, 16:46
I have a question.
How can I get a mysql variable from a mysql field faster?
I like to do a mysql save system, so switch to mysql and I have around 400 variables which will save & load in player's file.
my loading:
but with ~400 variables it will be too long..
I use strickenkid's mysql plugin.
these things I only used to test and worked..
How can I get a mysql variable from a mysql field faster?
I like to do a mysql save system, so switch to mysql and I have around 400 variables which will save & load in player's file.
my loading:
pawn Код:
...
new Query[128];
format( Query, sizeof( Query ), "SELECT * FROM `users` WHERE `ID` = %d",FieldID[playerid]);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
new line[900],id,pname[MAX_PLAYER_NAME],pass[20],ip[16],money, score,kills,deaths,alevel;
if(mysql_fetch_row(line))
{
sscanf(line, "p<|>dsssddddd", id,pname,pass,ip,money,score,kills,deaths,alevel); //Splits the line with sscanf
GivePlayerCash(playerid,money);
printf("Money: %d",money);
SetPlayerScore(playerid,score);
printf("Score: %d",score);
PlayerInfo[playerid][pAdmin] = alevel;
printf("Level: %d",alevel);
}
}
...
I use strickenkid's mysql plugin.
these things I only used to test and worked..