31.01.2011, 10:32
I have a question.
I have changed all in SavePInfo and MySQL database to save the score. here is the code
But I don't know much of sscanf and I can't understand what to change in load pinfo.
I would like to know how to change this.
Best Regards,
MarMigs
I have changed all in SavePInfo and MySQL database to save the score. here is the code
pawn Код:
stock SavePInfo(playerid)
{
if(GetPVarInt(playerid, "LoggedIN") == 1)
{
new
Query[600];
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `kills` = %d,`score` = %d, `deaths` = %d, `money` = %d, `Level` = %d, `Last Pos X` = %f, `Last Pos Y` = %f, `Last Pos Z` = %f, `Interior` = %d WHERE `user` = '%s'", // Also remember to update this...
PVar[playerid][pKills],
GetPlayerScore(playerid), // <---- This is my change. see score in SQL code too.
PVar[playerid][pDeaths],
GetPlayerMoney(playerid),
PVar[playerid][pLevel],
PVar[playerid][pLastX],
PVar[playerid][pLastY],
PVar[playerid][pLastZ],
GetPlayerInterior(playerid),
pName(playerid));
mysql_query(Query);
mysql_free_result();
return 1;
}
else return 0;
}
pawn Код:
stock LoadPlayerInfo(iPlayer)
{
new
Query[700];
if(mysql_fetch_row(Query))
{
sscanf(Query, "e<p<|>s[24]s[35]ddddfffd>", PVar[iPlayer]); // Remember to update this if you add more info...
mysql_free_result();
}
return 1;
}
Best Regards,
MarMigs