OnVehicleDeat - 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: OnVehicleDeat (
/showthread.php?tid=171900)
OnVehicleDeat -
cruising - 28.08.2010
Why does the vehicles respawn when i have this code? it shouldn't respawn again after death?
Code:
public OnVehicleDeath(vehicleid)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(0);
}
return 1;
}
Re: OnVehicleDeat -
Sergei - 28.08.2010
Because you respawn all vehicles.
Re: OnVehicleDeat -
[HiC]TheKiller - 28.08.2010
pawn Code:
public OnVehicleDeath(vehicleid)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
return 1;
}
It should be that but why would you respawn every vehicle when 1 vehicle dies? Makes no sense to me.
Re: OnVehicleDeat -
cruising - 28.08.2010
Quote:
Originally Posted by Sergei
Because you respawn all vehicles.
|
Then how do i make a car not to respawn after death?
because this should make cars not to respawn,
Code:
SetVehicleToRespawn(0);
Tried it on OnGameModeInit to, but it still respawn the car you crash.
Re: OnVehicleDeat -
Adil - 28.08.2010
Quote:
Originally Posted by cruising
Why does the vehicles respawn when i have this code? it shouldn't respawn again after death?
Code:
public OnVehicleDeath(vehicleid)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(0);
}
return 1;
}
|
The Parameter of SetVehicleRespawn is asking you the vehicleid, so if you write 0 there, vehicleid 0 will be respawned.
Re: OnVehicleDeat -
[XST]O_x - 28.08.2010
You are looping through all vehicles then only respawning vehicle ID 0?
And if you want only the vehicle that died to respawn:
pawn Code:
public OnVehicleDeath(vehicleid,killerid)
{
SetVehicleToRespawn(vehicleid);
return 1;
}
EDIT: If you want the car NOT to respawn,put the 'respawntime' or 'respawndelay' in CreateVehicle or AddStaticVehicleEx as -1.
Re: OnVehicleDeat -
cruising - 28.08.2010
Sorry if i make you guys not understand me.
i mean i dont want that vehicle who died to respawn. if you blow up your car it will not respawn again
Re: OnVehicleDeat -
[XST]O_x - 28.08.2010
Read my edit,if you don't want it to respawn just place the 'respawntime' or 'respawndelay' parameter as -1.
Like this:
pawn Code:
AddStaticVehicleEx(411,x,y,z,angle,color1,color2,-1);
or
pawn Code:
CreateVehicle(411,x,y,z,agnle,color1,color2,-1);
Or just use AddStaticVehicle.
Re: OnVehicleDeat -
cruising - 28.08.2010
Quote:
Originally Posted by [XST]O_x
Read my edit,if you don't want it to respawn just place the 'respawntime' or 'respawndelay' parameter as -1.
Like this:
pawn Code:
AddStaticVehicleEx(411,x,y,z,angle,color1,color2,-1);
or
pawn Code:
CreateVehicle(411,x,y,z,agnle,color1,color2,-1);
Or just use AddStaticVehicle.
|
sorry didnt see your edit.
it doenst work. i did like this
Code:
AddStaticVehicleEx(476,-1511.3623,-164.6398,14.8441,11.8009,6,6,-1);
Re: OnVehicleDeat -
Claude - 28.08.2010
pawn Code:
public OnVehicleDeath(vehicleid, killerid)
{
DestroyVehicle(vehicleid);
return 1;
}