SA-MP Forums Archive
How can i make /v spawned vehs. dont respawn - 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: How can i make /v spawned vehs. dont respawn (/showthread.php?tid=137570)



How can i make /v spawned vehs. dont respawn - Majataka - 29.03.2010

O hei der!
Im using Simon's debug mode "DEBUG_05c" and i would like to know how to make the /v spawned vehicles dont repsawn. Because if i /v and blow the car up... it respawns at the place where i spawned it. I tried to fix it on my own but looks like i dont know how to. So please help :>


Re: How can i make /v spawned vehs. dont respawn - Mikep. - 29.03.2010

P: hei

OnVehicleSpawn DestroyVehicle.


Re: How can i make /v spawned vehs. dont respawn - Majataka - 29.03.2010

Quote:
Originally Posted by Mikep.
P: hei

OnVehicleSpawn DestroyVehicle.
loloz mike hei der P::P Thanks i'll try

Off Topic. Looks like you will have to make Mike's English Lessons here too :P:P
Quote:
Originally Posted by Mikep.
No grills here, there are some good looking BBQs though.

Why can nobody spell on this forum :/



Re: How can i make /v spawned vehs. dont respawn - Mikep. - 29.03.2010

P:

OnVehicleSpawn should only be called when I vehicle REspawns, i'm not sure though, try it and tell me if it works.


Re: How can i make /v spawned vehs. dont respawn - dice7 - 29.03.2010

OnVehicleSpawn is called when a vehicle respawns. When you create the vehicle via /v, save the id and when It's destroyed ingame, check if the id matches the one in OnVehicleSpawn and then destroy the vehicle with DestroyVehicle


Re: How can i make /v spawned vehs. dont respawn - Majataka - 29.03.2010

Doing what Mike said over msn P: Hope it works, BRB testing


Re: How can i make /v spawned vehs. dont respawn - biltong - 29.03.2010

I had that issue, I fixed it by doing this:

pawn Код:
new ShouldntVehicleRespawn[MAX_VEHICLES];

//Whenever you use your /v command, at the creating the vehicle bit
new vehicleid = CreateVehicle(....);
ShouldntVehicleRespawn[vehicleid] = 1;

public OnVehicleSpawn(vehicleid)
{
  if(ShouldntVehicleRespawn[vehicleid] == 1) DestroyVehicle(vehicleid);
  return 1;
}
Problem solved.


Re: How can i make /v spawned vehs. dont respawn - Majataka - 29.03.2010

Naa Thanks to Mike :>
Код:
public OnVehicleSpawn(vehicleid)
{
	DestroyVehicle(vehicleid);
  return 1;
}
short and easy :>


Re: How can i make /v spawned vehs. dont respawn - biltong - 30.03.2010

True, but that means ALL vehicles don't respawn, not just the ones that you spawn with /v.