MySQL not saving data.(somewheres a mistake)
#5

Sure.So after buying a car, it saves all the data without any probs.
PHP код:
stock BuyCar(playerididx)
{
    if(
GetPlayerHouse(playerid) == 1)
    {
        new 
Float:xFloat:yFloat:zFloat:fa,cost[MAX_PLAYERS],model[MAX_PLAYERS], GetPVarInt(playerid"PlayerHouse");
        switch(
InShop[playerid])
        {
            case 
1cost[playerid]=GetInflationPrice(carsC[pPressed[playerid]][1]), model[playerid]=carsC[pPressed[playerid]][0], x=542.2341y=-1291.1302z=17.2422fa=0.9819;
            case 
2cost[playerid]=GetInflationPrice(carsB[pPressed[playerid]][1]), model[playerid]=carsB[pPressed[playerid]][0], x=-1957.9304y=305.4497z=35.4688fa=179.9544;
            case 
3cost[playerid]=GetInflationPrice(carsA[pPressed[playerid]][1]), model[playerid]=carsA[pPressed[playerid]][0], x=2200.7061y=1392.0594z=10.8203fa=180.9670;
        }
        if(
PlayerInfo[playerid][pBank] < cost[playerid]) return SendClientMessage(playeridCOLOR_GREYYouDoNotHaveEnoughMoney);
        
InShop[playerid] = 0;
        
TogglePlayerControllable(playerid,true);
        
Exchequer+=cost[playerid];
        
format(query64"UPDATE "TABLE_PICK" SET exchequer = %d"Exchequer);
        
PlayerInfo[playerid][pBank] -= cost[playerid];
        
TextDrawHideForPlayer(playerid,VehNazv[playerid]);
        
TextDrawHideForPlayer(playerid,VehCost[playerid]);
        
TextDrawHideForPlayer(playerid,PressA);
        
TextDrawHideForPlayer(playerid,PressD);
        
TextDrawHideForPlayer(playerid,PressH);
        
TextDrawHideForPlayer(playerid,PressC);
        
TextDrawHideForPlayer(playerid,PressB);
        
TextDrawHideForPlayer(playerid,VehBox);
        
t_SetPlayerPos(playerid,x,y,z);
        
SetPlayerFacingAngle(playerid,fa);
        
AC_BS_SetPlayerInterior(playerid,0);
        
AC_BS_SetPlayerVirtualWorld(playerid,0);
        
SetCameraBehindPlayer(playerid);
        
strmid(CarInfo[idx][cOwner],sendername(playerid),0,strlen(sendername(playerid)),MAX_PLAYER_NAME);
        
CarInfo[idx][cModel]=model[playerid];
        
CarInfo[idx][cCost]=cost[playerid];
        
CarInfo[idx][cLock]=1;
        
CarInfo[idx][cX] = HouseInfo[h][hCarx];
        
CarInfo[idx][cY] = HouseInfo[h][hCary];
        
CarInfo[idx][cZ] = HouseInfo[h][hCarz];
        
CarInfo[idx][cFa] = HouseInfo[h][hCarfa];
        
CarInfo[idx][cHeal] = 1000;
        
CarInfo[idx][cFuel] = 200;
        
CarInfo[idx][cColor][0]=colors[playerid][0];
        
CarInfo[idx][cColor][1]=colors[playerid][1];
        
CarInfo[idx][id] = idx;
        
SetPVarInt(playerid"PlayerCars"CarInfo[idx][id]);
        
format(CarInfo[idx][cColors], 16"%d, %d",CarInfo[idx][cColor][0],CarInfo[idx][cColor][1]);
        
strmid(CarInfo[idx][cOwner],sendername(playerid),0,strlen(sendername(playerid)),MAX_PLAYER_NAME);
        
SendMes(playeridTEAM_BLUE_COLOR"Jus nopirkat transportlidzekli: %s par %d Eiro",VehicleNameS[GetVehicleModel(veh[playerid])-400],CarInfo[idx][cCost]);
        
SendClientMessage(playerid,TEAM_BLUE_COLOR,"Jusu transportlidzeklis piegadats pie majas!");
        
DestroyVehicle(veh[playerid]);
        
format(query,sizeof(query),"UPDATE "TABLE_CARS" SET clock = %i, model = %i,cost = %i,colors = '%s', x = '%f', y='%f', z='%f', fa='%f', fuel = %i, heal = '%f' WHERE id = %i",CarInfo[idx][cLock],CarInfo[idx][cModel],
        
CarInfo[idx][cCost],CarInfo[idx][cColors],CarInfo[idx][cX], CarInfo[idx][cY], CarInfo[idx][cZ], CarInfo[idx][cFa], CarInfo[idx][cFuel], CarInfo[idx][cHeal], idx);
        
mysql_query(query); 
Also, MySQL log shows:
PHP код:
00:53:34] >> mysql_queryConnection handle)
[
00:53:34CMySQLHandler::Query(UPDATE cars SET clock 1model 458,cost 480000,colors '0, 0''1848.738647'y='-1926.755737'z='13.207628'fa='89.873275'fuel 200heal '1000.000000' WHERE id 1) - Successfully executed
BUT, if i change the color in tuning, MySQL log gives no info. It just doesnt record anything.
Reply


Messages In This Thread
MySQL not saving data.(somewheres a mistake) - by GuitarMan - 01.12.2014, 11:04
Re: MySQL not saving data.(somewheres a mistake) - by swiftyrus - 01.12.2014, 11:59
Re: MySQL not saving data.(somewheres a mistake) - by GuitarMan - 01.12.2014, 12:07
Re: MySQL not saving data.(somewheres a mistake) - by zT KiNgKoNg - 01.12.2014, 12:16
Re: MySQL not saving data.(somewheres a mistake) - by GuitarMan - 01.12.2014, 12:20
Re: MySQL not saving data.(somewheres a mistake) - by zT KiNgKoNg - 01.12.2014, 12:51
Re: MySQL not saving data.(somewheres a mistake) - by GuitarMan - 14.12.2014, 21:41

Forum Jump:


Users browsing this thread: 1 Guest(s)