Change vehicle's VW
#1

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?
Reply
#2

Store the VW to an array or retrieve by whom that vehicle is owned/spawned and set the VW back in OnVehicleSpawn callback.
Reply
#3

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

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)