Tuned car respawns as normal
#1

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);
Reply
#2

Код:
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;
}
Reply
#3

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.
Reply
#4

So what now?
Reply
#5

bump, 16 hours later :P
Reply
#6

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.
Reply
#7

add it to OnFilterScriptInit()
Reply
#8

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

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.
Reply
#10

What's the easiest way?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)