06.08.2013, 23:49
Basically I've scripted it so that players can save modifications, bumper, spoiler etc to their vehicle. Everything works, accept when the car blows up, it doesn't seem to put the mods back on their vehicle.
When they log in, it adds the modifications to their vehicle with a function that I've made
That's under the selection where it creates the players vehicle when they log in.
Like I said everything is working. But when the vehicle gets blown up and respawns, the modifications are no longer on their vehicle..
Can anyone help me figure out what I need to do in order for the modifications to add themselves back to the vehicle after it respawns?
I've tried a function on "OnVehicleSpawn". However, it does nothing.
When they log in, it adds the modifications to their vehicle with a function that I've made
Code:
AddVehicleModifications(playerid);
Like I said everything is working. But when the vehicle gets blown up and respawns, the modifications are no longer on their vehicle..
Code:
PlayerInfo[playerid][pHouseCarID] = CreateVehicle(housecar,PlayerInfo[playerid][pHouseCarX],PlayerInfo[playerid][pHouseCarY],PlayerInfo[playerid][pHouseCarZ],PlayerInfo[playerid][pHouseCarFacing],PlayerInfo[playerid][pHouseCarColor],PlayerInfo[playerid][pHouseCarColor2],180000); AddVehicleModifications(playerid);
Code:
public AddVehicleModifications(playerid) { if(IsPlayerConnected(playerid)) { AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pSpoiler]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pHood]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pRoof]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pSideskirt]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pLamps]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pExhaust]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pWheels]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pBumperF]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pBumperR]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pVentR]); AddVehicleComponent(PlayerInfo[playerid][pHouseCarID],PlayerInfo[playerid][pVentL]); } return 1; }
I've tried a function on "OnVehicleSpawn". However, it does nothing.