CreateVehicle - 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: CreateVehicle (
/showthread.php?tid=389601)
CreateVehicle -
Brandlax - 02.11.2012
I want that when players type /v a car is created. I used CreateVehicle for that. But the problem is I don't want that vehicle to respawn in the same area after vehicle death. I can't figure out a way to do that!
Re: CreateVehicle -
Private200 - 02.11.2012
Lool, you don't need CreateVehicle for that , you need a filterscript .
But if you are using /v only for one vehicle , then it is right .
And if you wanna help you about the :
Quote:
Originally Posted by Brandlax
I don't want that vehicle to respawn in the same area after vehicle death. I can't figure out a way to do that!
|
you need to give us the code, so we see where the problem is ..
Re: CreateVehicle -
Lorrden - 02.11.2012
https://sampwiki.blast.hk/wiki/DestroyVehicle
Quote:
Lool, you don't need CreateVehicle for that , you need a filterscript .
But if you are using /v only for one vehicle , then it is right.
|
... Just to sort things out.. You need "fsdebug.amx" to be more specific, which is included in the original Server Folder.
Re: CreateVehicle -
adsy - 02.11.2012
ok well i had this issue
REALLY REALLY EASY!
CreateVehicle(vehid,xpos,ypos,zpos,angle+90,-1,-1,-1);
look at the last bit:
-1
thats all you need to do!
Re: CreateVehicle -
Brandlax - 02.11.2012
Quote:
Originally Posted by adsy
ok well i had this issue
REALLY REALLY EASY!
CreateVehicle(vehid,xpos,ypos,zpos,angle+90,-1,-1,-1);
look at the last bit:
-1
thats all you need to do!
|
I think you misunderstood my question.
Anyways, I figured it out. Everytime the player spawns his bought vehicle, it's ID starts from 191. I added
Код:
if(vehicleid > 190) DestroyVehicle(vehicleid);
in the OnVehicleDeath function. So that means if the player creates vehicles themeselves, and if that vehicle explodes, it will never again respawn in the same area.
Re: CreateVehicle -
adsy - 02.11.2012
Ah well I spose I should show my second half of the script i use really:
Код:
public OnVehicleDeath(vehicleid)
{
SetTimer("removevehicledelay",10000, false);
return 1;
}
forward removevehicledelay(vehicleid);
removevehicledelay(vehicleid)
{
DestroyVehicle(vehicleid);
return 1;
}