Mysql putting info in the Wrong place
#1

Hello ,

directly : after im doing the command /apark , it destroyes the vehicle and it never come back till i'll relog ( i will find the car in the last position before i'll do apark)


here is the update of mysql


PHP код:
Onplayerupdatevalue 4 this one 
.
.
.
mysql_format(dbhandlequerysizeof query"INSERT INTO vehicles VALUES (%d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, '%e', %d, %d, %d, %d, '%e') \
        ON DUPLICATE KEY UPDATE    id = LAST_INSERT_ID(id), model = VALUES(model), "
,
        
CarInfo[idx][cdbID], CarInfo[idx][cModel], CarInfo[idx][cLocationx],    CarInfo[idx][cLocationy],
        
CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo],
        
0CarInfo[idx][cOwner], CarInfo[idx][cLock], CarInfo[idx][cPaintjob], CarInfo[idx][cVirWorld], CarInfo[idx][cCode], CarInfo[idx][cPlate]);
strcat(query"locX = VALUES(locX), \
        locY = VALUES(locY), locZ = VALUES(locZ), angle = VALUES(angle), \
        color1 = VALUES(color1), color2 = VALUES(color2), ownerId = VALUES(ownerId), \
        owner = VALUES(owner),\
        locked = VALUES(locked), paintjob = VALUES(paintjob), \
        virtualworld = VALUES(virtualworld), code = VALUES(code), plate = VALUES(plate)"
);
        
mysql_tquery_inline(dbhandlequeryusing CarHandler""); 
here is a picture when im doing the command




here is the command apark

PHP код:
YCMD:apark(playeridparams[], help)
{
    if(
help) return SCM(playeridCOLOR_GREY"Not supported");
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:x,Float:y,Float:z,Float:a,carid,string[256];
        
carid GetPlayerVehicleID(playerid);
        
GetVehiclePos(caridxyz);
        
GetVehicleZAngle(carida);
        if(
PlayerInfo[playerid][pAdmin] >= 1)
        {
            if(
IsAnOwnableCar(carid))
            {
                
CarInfo[carid][cLocationx] = x;
                
CarInfo[carid][cLocationy] = y;
                
CarInfo[carid][cLocationz] = z;
                
CarInfo[carid][cAngle] = a;
                
format(stringsizeof(string), "~n~ You have parked your car in this location. ~n~");
                
GameTextForPlayer(playerid"You have parked this car in this position. It will respawn here."100003);
                
OnPropUpdate(4,carid);
                
DestroyVehicle(carid);
                
ownedcar[carid] = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                if(
CarInfo[carid][cPaintjob] != 999)
                {
                    
ChangeVehiclePaintjob(caridCarInfo[carid][cPaintjob]);
                }
                
SetVehicleModifications(carid);
                
PutPlayerInVehicle(playeridcarid0);
                new 
lightsalarmdoorsbonnetbootobjective;
                
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1lightsalarmdoorsbonnetbootobjective);
                  
engineOn[GetPlayerVehicleID(playerid)] = true;
                  
TogglePlayerControllable(playerid1);
                return 
1;
            }
            else
            {
                
SCM(playeridCOLOR_GREY"* You can only do this on ownable cars!");
                return 
1;
            }
        }
        else
        {
            
SCM(playeridCOLOR_GREY"* You are not authorized to use that command !");
            return 
1;
        }
    }
    return 
1;

Reply


Messages In This Thread
Mysql putting info in the Wrong place - by MCZOFT - 13.01.2015, 21:58
Re: Mysql putting info in the Wrong place - by donsta3000 - 13.01.2015, 22:46
Re: Mysql putting info in the Wrong place - by Vince - 13.01.2015, 23:03
Re : Mysql putting info in the Wrong place - by MCZOFT - 13.01.2015, 23:18
Re: Re : Mysql putting info in the Wrong place - by Vince - 13.01.2015, 23:28
Re : Mysql putting info in the Wrong place - by MCZOFT - 13.01.2015, 23:32
Re : Mysql putting info in the Wrong place - by MCZOFT - 14.01.2015, 12:58

Forum Jump:


Users browsing this thread: 3 Guest(s)