PDA

View Full Version : Tunning


norton2
07/02/2015, 02:43 PM
Callback `Tunen` does not work. Not tuning car!
public Tunen(vehicleid)
{
if(VehiclesInfo[vehicleid][vComponent1]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent1]); }
if(VehiclesInfo[vehicleid][vComponent2]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent2]); }
if(VehiclesInfo[vehicleid][vComponent3]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent3]); }
if(VehiclesInfo[vehicleid][vComponent4]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent4]); }
if(VehiclesInfo[vehicleid][vComponent5]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent5]); }
if(VehiclesInfo[vehicleid][vComponent6]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent6]); }
if(VehiclesInfo[vehicleid][vComponent7]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent7]); }
if(VehiclesInfo[vehicleid][vComponent8]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent8]); }
if(VehiclesInfo[vehicleid][vComponent9]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent9]); }
if(VehiclesInfo[vehicleid][vComponent10]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent10]); }
if(VehiclesInfo[vehicleid][vComponent11]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent11]); }
if(VehiclesInfo[vehicleid][vComponent12]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent12]); }
if(VehiclesInfo[vehicleid][vComponent13]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent13]); }
if(VehiclesInfo[vehicleid][vComponent14]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent14]); }
if(VehiclesInfo[vehicleid][vComponent15]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent15]); }
if(VehiclesInfo[vehicleid][vComponent16]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent16]); }
if(VehiclesInfo[vehicleid][vComponent17]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[vehicleid][vComponent17]); }
if(VehiclesInfo[vehicleid][vColor1] != 0 || VehiclesInfo[vehicleid][vColor2] != 0)
{
ChangeVehicleColor(vehicleid,VehiclesInfo[vehicleid][vColor1],VehiclesInfo[vehicleid][vColor2]);
}
if(VehiclesInfo[vehicleid][vPaintJob]!=0) { ChangeVehiclePaintjob(vehicleid,VehiclesInfo[vehicleid][vPaintJob]); }
}

CMD:respawnveh(playerid, params [])
{
for(new v = 0; v < sizeof(VehiclesInfo); v++)
{
if(VehiclesInfo[v][vOwner] == PlayerInfo[playerid][pID] && VehiclesInfo[v][vSlot] == 1)
{
SetVehicleToRespawn(VehiclesInfo[v][vServerID]);
SendClientMessage(playerid, COLOR_YELLOW, "car respawned!");
Tunen(v);
}
}
return 1;
}

HazardouS
07/02/2015, 02:47 PM
Did you make sure that VehiclesInfo[vehicleid][vComponent<1-17>] are valid and not 0?

norton2
07/02/2015, 02:49 PM
Yes.

http://i.imgur.com/ZI9k3ou.png?1

HazardouS
07/02/2015, 03:41 PM
I meant in-game, but probably your loading system works fine.

Try moving the Tuning function under OnVehicleSpawn.

norton2
07/02/2015, 04:28 PM
not working

public OnVehicleSpawn(vehicleid)
{
Tunen(vehicleid);
return 1;
}