02.10.2011, 04:31
This is my Code in my script which saves and loads playerinfo.
Do you want more of the debug?
pawn Код:
stock SavePInfo(playerid)
{
if(GetPVarInt(playerid, "LoggedIN") == 1)
{
new Query[600];
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `kills` = %d, `deaths` = %d, `money` = %d, `Level` = %d, `Score` = %d, `VIP` = %d, `Ban` = %d, `Connect` = %d WHERE `user` = '%s'", // Also remember to update this...
Account[playerid][pKills],
Account[playerid][pDeaths],
GetPlayerMoney(playerid),
Account[playerid][pLevel],
GetPlayerScore(playerid),
Account[playerid][pVIP],
Account[playerid][pBanned],
Account[playerid][pConnect],
pName(playerid));
mysql_query(Query);
mysql_free_result();
AvoidOOSync();
return 1;
}
else return 0;
}
stock LoadPlayerInfo(iPlayer)
{
new Query[700];
if(mysql_fetch_row(Query))
{
sscanf(Query, "p<|>e<s[24]s[35]dddddddd>",Account[iPlayer]);
mysql_free_result();
}
return 1;
}