CreateVehicle
#1

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

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

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

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)