Vehicle virtual world and interior - 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: Vehicle virtual world and interior (
/showthread.php?tid=86377)
Vehicle virtual world and interior -
Sergei - 13.07.2009
Hello ... again.
I've got another problem which I don't see solution for it.
I made that vehicles save their virtual world and interior in the file. On server restart 'LoadDynamicCars()' is called which spawns all the cars from the file. I also added SetVehicleVirtualWorld & LinkVehicleToInterior, so vehicles would be set in the right vw and interior.
When I teleport to interior and vw where vehicle should spawn there is nothing. I put myself in that vehicle ID and I become invisable (I am still in the right interior and virtual world). I use command which just does
Код:
new inter = GetPlayerInterior(playerid);
new world = GetPlayerVirtualWorld(playerid);
LinkVehicleToInterior(vehicleid, DynamicCars[car][Interior]);
SetVehicleVirtualWorld(vehicleid, DynamicCars[car][World]);
and I and vehicle become visable.
So basically vehicle is in the right virtual world and interior just stuck a little bit off ground and invisable. When I put myself in that vehicle vehicle blink a bit, so I can see it for a second before it disappears.
Oh and vehicles in vw and interior 0 spawn normally, just vehicles in any other interiors and virtual worlds cause problems. I have also tried to call SetVehicleVirtualWorld & LinkVehicleToInterior two times on 'LoadDynamicCars()', but nothing has changed.
I was thinking quite a bit, but I haven't found any solution to this yet.
Thanks for help
Re: Vehicle virtual world and interior -
Sergei - 13.07.2009
I have tried adding static vehicle now and it happens the same.
pawn Код:
new vehicle1 = AddStaticVehicle(468,-1430.6820,-630.2808,1049.8923,279.2261,5,5); //Sanchez
LinkVehicleToInterior(vehicle1, 4);
SetVehicleVirtualWorld(vehicle1, 7);
I guess it's SA:MP bug? And if it is, any way to avoid it?
Re: Vehicle virtual world and interior -
lavamike - 13.07.2009
I've never had any problems linking a vehicle to an interior and changing it's virtual world, not sure...
Re: Vehicle virtual world and interior -
Sergei - 13.07.2009
It seems today is nto my scripting day
Nothing works
It's weird that even static vehicle doesn't appear in right interior and vw :/
I also added myself some debug messages and everything seemed to be okay and IG it's not
Re: Vehicle virtual world and interior -
Sergei - 14.07.2009
It works now. I made a timer on GameModeInit which calls a function which sets vehicle virtual worlds.