Change vehicle's VW - 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: Change vehicle's VW (
/showthread.php?tid=578679)
Change vehicle's VW -
cnoopers - 21.06.2015
What's up good people,
I have a little trouble about changing vehicle's virtual world after its death, there I got table
pveh[10][MAX_PLAYERS] which cars are spawned after player log-in to his unique world (playerid+1). The problem is that after death vehicle is going to world 0, how can I take him to previous player's world?
Re: Change vehicle's VW -
Konstantinos - 21.06.2015
Store the VW to an array or retrieve by whom that vehicle is owned/spawned and set the VW back in OnVehicleSpawn callback.
Re: Change vehicle's VW -
cnoopers - 21.06.2015
Yeah but we got no playerid argument which is able to use under OnVehicleSpawn, that's the cause why imma be askin you guys. Maybe use loop for players or pvar? It ain't gonna be optimal.
Re: Change vehicle's VW -
Konstantinos - 21.06.2015
Then go for the first one - an array with size of MAX_VEHICLES and store the VW the vehicle is in when
dies and set it back when it re-spawns.
Re: Change vehicle's VW -
cnoopers - 21.06.2015
Seems be kinda simply but it doesn't work:
Код:
public OnVehicleSpawn(vehicleid)
{
SetVehicleVirtualWorld(vehicleid, pvehworld[vehicleid]);
return 1;
}
public OnVehicleDeath(vehicleid)
{
pvehworld[vehicleid] = GetVehicleVirtualWorld(vehicleid);
return 1;
}
What is code supposed to be like?