Help not retain the second car
#3

Quote:
Originally Posted by TheRohlikar
View Post
" new veh = playerCar1 [ playerid ] ;"

in both stocks

btw. easier and better:

Code:
stock savePlayerCar( playerid, veh) {
    new query [ 1050] , Float:posi [ 4 ] , Float:hp , Engine , Lights , Alarm, Doors, Bonnet, Boot, Objective;
    if ( veh != -1 ) {
        GetVehiclePos ( veh , posi [ 0 ] , posi [ 1 ] , posi [ 2 ] ) ;
        GetVehicleZAngle ( veh , posi [ 3 ] ) ;
        GetVehicleParamsEx ( veh , Engine , Lights , Alarm , Doors , Bonnet , Boot , Objective ) ;
        SetVehicleParamsEx ( veh , Engine , Lights , Alarm , Doors , Bonnet , Boot , Objective ) ;
        GetVehicleHealth ( veh , hp ) ;
        format ( query , sizeof ( query ) ,
        "UPDATE cars SET \
          posX = '%f',\
          posY = '%f',\
          posZ = '%f',\
          posA = '%f',\
          lastPosX = '%f',\
          lastPosY = '%f',\
          lastPosZ = '%f',\
          lastPosA = '%f',\
          sprogo = %d,\
          locked = %d,\
          numbers = '%s',\
          engine = %d,\
          lights = %d,\
          hp = '%f',\
          rida = '%f',\
          gas = %d,\
          paintjob = %d,\
          color1 = %d,\
          color2 = %d, \
          vZole = '%d',\
          vLSD = '%d',\
          vAmfa = '%d',\
          akumas = '%d',\
          akumohp = '%f'\
          WHERE owner = '%s'" ,
        posi [ 0 ] , posi [ 1 ] , posi [ 2 ] , posi [ 3 ] ,
        posi [ 0 ] , posi [ 1 ] , posi [ 2 ] , posi [ 3 ] ,
        vehicleDB [ veh ] [ vSprogo ] , vehicleDB [ veh ] [ vLocked ] ,
        vehicleDB [ veh ] [ numeriai ] , Engine , Lights ,  hp , vehicleDB [ veh ] [ Rida ] , vehicleDB [ veh ] [ gas ] , vehicleDB [ veh ] [ vPaintjob ] , vehicleDB [ veh ] [ vColor ] [ 0 ],
        vehicleDB [ veh ] [ vColor ] [ 1 ] ,vehicleDB[veh][vZole],vehicleDB[veh][vLSD],vehicleDB[veh][vAmfa],vehicleDB[veh][akumas],vehicleDB[veh][akumohp], GetPlayerNameEx ( playerid ) ) ;
        mysql_query ( query ) ;
        for ( new t = 0; t < 13; t ++ ) {
            format ( query , sizeof ( query ) , "UPDATE cars SET tune%d = %d WHERE owner = '%s'" , t , vehicleDB [ veh ] [ vTune ] [ t ] , GetPlayerNameEx ( playerid ) ) ;
            mysql_query ( query ) ;
        }
        DestroyVehicle ( veh ) ;
    }
    return 1;
}
Using:

Code:
#define MAX_PVEHICLES 10   
new playerCar[MAX_PLAYERS][MAX_PVEHICLES];


savePlayerCar(playerid, player[playerid][0]);
Once this code is that I do it http://pastebin.com/RdB3vdeh
Reply


Messages In This Thread
Help not retain the second car - by TMapping - 30.11.2016, 10:01
Re: Help not retain the second car - by TheRohlikar - 30.11.2016, 10:50
Re: Help not retain the second car - by TMapping - 30.11.2016, 11:16
Re: Help not retain the second car - by TheRohlikar - 30.11.2016, 11:18
Re: Help not retain the second car - by TMapping - 30.11.2016, 11:31
Re: Help not retain the second car - by TheRohlikar - 30.11.2016, 11:35
Re: Help not retain the second car - by TMapping - 30.11.2016, 13:01
Re: Help not retain the second car - by TMapping - 18.04.2019, 10:26

Forum Jump:


Users browsing this thread: 1 Guest(s)