SA-MP Forums Archive
Tuned car respawns as normal - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tuned car respawns as normal (/showthread.php?tid=146221)



Tuned car respawns as normal - Andy_McKinley - 06.05.2010

I tuned my cars in my gamemode script and it works fine, but when it explodes or respawns, it respawns as a normal car.

pawn Код:
new elegy;

elegy = AddStaticVehicle(562, -2960.0324707031, 459.45205688477, 4.6676120758057, 0.000000, 3, 3);
    ChangeVehiclePaintjob(elegy, 0);
    AddVehicleComponent(elegy, 1010);
    AddVehicleComponent(elegy, 1037);
    AddVehicleComponent(elegy, 1036);
    AddVehicleComponent(elegy, 1040);
    AddVehicleComponent(elegy, 1098);
    AddVehicleComponent(elegy, 1146);
    AddVehicleComponent(elegy, 1171);
    AddVehicleComponent(elegy, 1149);



Re: Tuned car respawns as normal - Martin_M - 06.05.2010

Код:
public OnVehicleSpawn(vehicleid)
{
if(vehicleid == elegy)
{
ChangeVehiclePaintjob(elegy, 0);
	AddVehicleComponent(elegy, 1010);
	AddVehicleComponent(elegy, 1037);
	AddVehicleComponent(elegy, 1036);
	AddVehicleComponent(elegy, 1040);
	AddVehicleComponent(elegy, 1098);
	AddVehicleComponent(elegy, 1146);
	AddVehicleComponent(elegy, 1171);
	AddVehicleComponent(elegy, 1149);
}
return 1;
}



Re: Tuned car respawns as normal - Jay_ - 06.05.2010

To my understanding, that wouldn't work because OnVehicleSpawn gets called prior to the vehicle actually spawning. You would have to use OnVehicleStreamIn or do it after a timer in OnVehicleSpawn.


Re: Tuned car respawns as normal - Andy_McKinley - 06.05.2010

So what now?


Re: Tuned car respawns as normal - Andy_McKinley - 07.05.2010

bump, 16 hours later :P


Re: Tuned car respawns as normal - xxjackoxx - 07.05.2010

Quote:
Originally Posted by _Jay_
To my understanding, that wouldn't work because OnVehicleSpawn gets called prior to the vehicle actually spawning. You would have to use OnVehicleStreamIn or do it after a timer in OnVehicleSpawn.



Re: Tuned car respawns as normal - [cA]Unforseen - 07.05.2010

add it to OnFilterScriptInit()


Re: Tuned car respawns as normal - Andy_McKinley - 07.05.2010

Guys, everyone says something different, I don't get it anymore...


Re: Tuned car respawns as normal - Valak - 07.05.2010

That's because there's multiple ways to do what you're asking. On the server I'm on we just saved the vehicle information to SQL including the mod info and it loads from there.


Re: Tuned car respawns as normal - Andy_McKinley - 07.05.2010

What's the easiest way?