MySQL problem..
#1

So I have a gamemode on mysql and I have a problem.
I have $ 100 and you leave the server doubles the money in my table ($ 200) why?
Reply
#2

Go on the server, leave with x money, look in the database to see if it is doubled BEFORE connecting again, and report back. That will determine whether the problem is with saving or loading.
Reply
#3

Said and done.Money is doubld on disconnect player ( saveplayerdata )
Reply
#4

Okay, show the code.
Reply
#5

pawn Код:
forward SavePlayerData(playerid);
public SavePlayerData(playerid)
{
    new query[700];
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    format(query, 700, "UPDATE `players` SET `Origin` = '%d', `Sex` = '%d', `FirstLogin` = '%d', `Staff` = '%d' WHERE `username` ='%s' ", AccountInfo[playerid][pOrigin], AccountInfo[playerid][pSex], AccountInfo[playerid][pFirstLogin], AccountInfo[playerid][pStaff], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Mapper` = '%d', `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f' WHERE `username` ='%s' ", AccountInfo[playerid][pMapper], x, y, z, ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Interior` = '%d', `SavePos` = '%d',`Member` = '%d' WHERE `username` ='%s' ",  GetPlayerInterior(playerid), AccountInfo[playerid][pSavePos], AccountInfo[playerid][pMember], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Rank` = '%d', `Bani` = '%d', `Warns` = '%d', `Age` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pRank], AccountInfo[playerid][pBani], AccountInfo[playerid][pWarns], AccountInfo[playerid][pAge], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `CarLic` = '%d', `FlyLic` = '%d', `BoatLic` = '%d', `GunLic` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pCarLic], AccountInfo[playerid][pFlyLic], AccountInfo[playerid][pBoatLic], AccountInfo[playerid][pGunLic], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `AccesDMV` = '%d', `UpgradeAge` = '%d', `Skin` = '%d', `Bilet` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pAccesDMV], AccountInfo[playerid][pUpgradeAge], AccountInfo[playerid][pSkin], AccountInfo[playerid][pBilet], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Ban` = '%d', `Job` = '%d', `JobEchipat` = '%d', `JobFinish` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pBan], AccountInfo[playerid][pJob], AccountInfo[playerid][pJobEchipat], AccountInfo[playerid][pJobFinish], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `JobPlata` = '%d', `JobTimed` = '%d', `JobTime` = '%d', `World` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pJobPlata], AccountInfo[playerid][pJobTimed], AccountInfo[playerid][pJobTime], AccountInfo[playerid][pWorld], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Muted` = '%d', `MuteTime` = '%d', `AmmuTrainTime` = '%d', `PistSkill` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pMuted], AccountInfo[playerid][pMuteTime], AccountInfo[playerid][pAmmuTrainTime], AccountInfo[playerid][pPistSkill], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `SilenSkill` = '%d', `DesertSkill` = '%d', `ShotgSkill` = '%d', `SmgSkill` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pSilenSkill], AccountInfo[playerid][pDesertSkill], AccountInfo[playerid][pShotgSkill], AccountInfo[playerid][pSmgSkill], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `AkSkill` = '%d', `M4Skill` = '%d', `Undite` = '%d', `Rame` = '%d' WHERE `username` ='%s' ",  AccountInfo[playerid][pAkSkill], AccountInfo[playerid][pM4Skill], AccountInfo[playerid][pUndite], AccountInfo[playerid][pRame], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `HouseKey` = '%d', `RentKey` = '%d', `CarKey` = '%d'` WHERE `username` ='%s' ",  AccountInfo[playerid][pPhousekey],  AccountInfo[playerid][pPrentkey], AccountInfo[playerid][pCarKey], ReturnName(playerid));
    mysql_query(query);
    format(query, 700, "UPDATE `players` SET `Scoala` = '%d', `Profil` = '%d', `Romana` = '%d', `RT1` = '%d', WHERE `username` ='%s' ",  AccountInfo[playerid][pScoala],  AccountInfo[playerid][pProfil],  AccountInfo[playerid][pRomana],  AccountInfo[playerid][pRT1], ReturnName(playerid));
    mysql_query(query);
    mysql_free_result();
}
pBani/Bani is pMoney/Money.
Reply
#6

Check the mySQL log. See what it's being saved as.
Reply
#7

pawn Код:
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Origin` = '2', `Sex` = '1', `FirstLogin` = '1', `Staff` = '5' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Mapper` = '0', `PosX` = '2719.636962', `PosY` = '-1769.138549', `PosZ` = '1604.602294' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Interior` = '1', `SavePos` = '1',`Member` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Rank` = '0', `Bani` = '400', `Warns` = '0', `Age` = '14' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `CarLic` = '0', `FlyLic` = '0', `BoatLic` = '0', `GunLic` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `AccesDMV` = '0', `UpgradeAge` = '0', `Skin` = '23', `Bilet` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Ban` = '0', `Job` = '0', `JobEchipat` = '0', `JobFinish` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `JobPlata` = '0', `JobTimed` = '0', `JobTime` = '0', `World` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Muted` = '0', `MuteTime` = '0', `AmmuTrainTime` = '0', `PistSkill` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `SilenSkill` = '0', `DesertSkill` = '0', `ShotgSkill` = '0', `SmgSkill` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `AkSkill` = '0', `M4Skill` = '0', `Undite` = '0', `Rame` = '0' WHERE `username` ='Wally_Larro' ) - Successfully executed.
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `HouseKey` = '0', `RentKey` = '0', `CarKey` = '255'` WHERE `username` ='Wally_Larro' ) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` WHERE `username` ='Wally_Larro'' at line 1)
[10:51:15] >> mysql_query( Connection handle: 1 )
[10:51:15] CMySQLHandler::Query(UPDATE `players` SET `Scoala` = '0', `Profil` = '0', `Romana` = '0', `RT1` = '0', WHERE `username` ='Wally_Larro' ) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `username` ='Wally_Larro'' at line 1)
[10:51:15] >> mysql_free_result( Connection handle: 1 )
Reply
#8

It saves as 400. Is that what you had? Is it 800 when you return? Or was it 200 before?
Reply
#9

So,i have 200$ on connect and on disconnect money is dubled on 400$.

Edit: Fixed..it wos from anticheat money.
Can u give me a money anticheat?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)