[HELP]DestroyVehicle and other question - 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: [HELP]DestroyVehicle and other question (
/showthread.php?tid=90235)
[HELP]DestroyVehicle and other question -
Martin_Smith - 07.08.2009
In my script i have a CreateVehicle and then a DestroyVehicle for that Car...Does desroy vehicle remove it from the script or simply respawn it?
also, in these code am i carrying the Car id for the created vehicle propaly..
car being made
Код:
new carcreated = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randcolor,randcolor,10000);
playercarid[playerid] = GetPlayerVehicleID(carcreated);
and this is being destroyed
Код:
new carid = playercarid[playerid];
DestroyVehicle(carid);
Re: [HELP]DestroyVehicle and other question -
Backwardsman97 - 07.08.2009
Destroying a vehicle removes it from the server. It is gone and the vehicle id is marked as invalid or something. It doesn't like physically remove it from the script if that's what you're asking. It doesn't set it to respawn, it just deletes it. And your second question, yes, that is how you would do it.
Re: [HELP]DestroyVehicle and other question -
[GM]The_Don - 07.08.2009
If You Want to Respawn your Vehicle Use this :
Код:
#define RESPAWN_TIME 10000 // 10 Seconds
new randcolor = -1; // -1 of Random Car Color
new Car = CreateVehicle(CarId,Carx,Cary,Carz,Carangel,randcolor,randcolor,RESPAWN_TIME);
new Vi = GetPlayerVehicleID(playerid, Car);
SetVehicleToRespawn(Vi);
regards
[GM]The_Don