02.05.2013, 20:01
As said above, my mysql system doesnt save the score/money.
SavePlayer:
And yes i did at onplayerdisconnect
My enum:
Please someone help me, because its important for my server.
SavePlayer:
pawn Код:
SavePlayer(playerid)
{
if(pInfo[playerid][Logged] == 1)
{
new Query[500];
format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `score` = '%d', `money` = '%d', `kills` = '%d', `deaths` = '%d' WHERE `id` = '%d' LIMIT 1",
pInfo[playerid][pAdmin],
pInfo[playerid][pScore],
pInfo[playerid][pMoney],
pInfo[playerid][pKills],
pInfo[playerid][pDeaths],
pInfo[playerid][ID]);
mysql_query(Query);
}
}
pawn Код:
SavePlayer(playerid);
pawn Код:
enum PlayerInfo
{
ID, // id of the player
pDutyOn,
pDutyOff,
Nick[24], // name of the player
pAdmin, // admin level of the player
pMoney, //money of the player
pKills, // Kills of the player
pDeaths, // deaths of the player
pScore, // score of the player
IP[16], // Storing the ip of the player
Logged, // Players logged in or not variable
IsRegistered //checks if the player is registered or not.
};