Carspawning
#1

Hey..
i got a carspawning filterscript, but when i spawn a vehicle, leave it, and spawn another one, the old vehicle stays.
any ideas to only have one vehicle spawned at time?

the code looks like this..
Код:
stock aCreateThing(playerid, thingid, orderid)
{
  new pVeh[MAX_PLAYERS] = -1;
  if(pVeh[playerid] != -1)
  DestroyVehicle(pVeh[playerid]);
	new Float:X, Float:Y, Float:Z, Float:Angle;
	GetPlayerPos(playerid, X, Y, Z);
	GetPlayerFacingAngle(playerid, Angle);
	if(thingid != 597)
	{
		Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, random(126), random(126), 30);
	}
	else
	{
	  Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, 0, 1, 30);
	}
	PutPlayerInVehicle(playerid, Vehicle[orderid], 0);
	TogglePlayerControllable(playerid, true);
	return 1;
}
If someone got a solution for this, please copy the code and add your sulution and post it. thanks.
Reply


Messages In This Thread
Carspawning - by RedFusion - 19.11.2009, 11:46
Re: Carspawning - by LarzI - 19.11.2009, 13:23
Re: Carspawning - by RedFusion - 19.11.2009, 14:03
Re: Carspawning - by LarzI - 19.11.2009, 14:23
Re: Carspawning - by RedFusion - 19.11.2009, 14:27
Re: Carspawning - by LarzI - 19.11.2009, 14:38
Re: Carspawning - by RedFusion - 19.11.2009, 14:50
Re: Carspawning - by RedFusion - 19.11.2009, 18:58

Forum Jump:


Users browsing this thread: 3 Guest(s)