Tunning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tunning (
/showthread.php?tid=562195)
Tunning -
norton2 - 07.02.2015
Callback `Tunen` does not work. Not tuning car!
Код HTML:
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]); }
}
Код HTML:
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;
}
Re: Tunning -
HazardouS - 07.02.2015
Did you make sure that VehiclesInfo[vehicleid][vComponent<1-17>] are valid and not 0?
Re: Tunning -
norton2 - 07.02.2015
Yes.
Re: Tunning -
HazardouS - 07.02.2015
I meant in-game, but probably your loading system works fine.
Try moving the Tuning function under OnVehicleSpawn.
Re: Tunning -
norton2 - 07.02.2015
not working
Код HTML:
public OnVehicleSpawn(vehicleid)
{
Tunen(vehicleid);
return 1;
}