14.06.2009, 12:53
There is a bit of a problem with that.
I could use that way, but if the car dies, it won't have the mods after respawn.
Also I found that if the component is set OnGamemodeInit then afte gmx this will crash everyone's game.
I took the advice from yezizhu and used SetTimerEx.
SetTimerEx("SetComponents",13000,0,"x",needsmods0) ; //in OnGamemodeInit
And to make sure the car has mods after death:
if(vehicleid == needsmods0) {
SetTimerEx("SetComponents",3000,0,"x",vehicleid); //in OnVehicleSpawn
}
It seems that AddVehicleComponent doesn't work on the exact the same time when OnVehicleSpawn is executed.
But thanks anyway!
I could use that way, but if the car dies, it won't have the mods after respawn.
Also I found that if the component is set OnGamemodeInit then afte gmx this will crash everyone's game.
I took the advice from yezizhu and used SetTimerEx.
SetTimerEx("SetComponents",13000,0,"x",needsmods0) ; //in OnGamemodeInit
And to make sure the car has mods after death:
if(vehicleid == needsmods0) {
SetTimerEx("SetComponents",3000,0,"x",vehicleid); //in OnVehicleSpawn
}
It seems that AddVehicleComponent doesn't work on the exact the same time when OnVehicleSpawn is executed.
But thanks anyway!