SA-MP Forums Archive
If vehicle hp... - 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: If vehicle hp... (/showthread.php?tid=260087)



If vehicle hp... - Face9000 - 07.06.2011

Hi guys,i want do if a player is in a hydra or hunter and the vehicle has -250 hp,it will show a message to all players.

How?


Re: If vehicle hp... - gamer931215 - 07.06.2011

-250 HP ?
i think it will explode already at 0 HP, what do you mean exactly ?


Re: If vehicle hp... - itachi4x4 - 07.06.2011

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Hi guys,i want do if a player is in a hydra or hunter and the vehicle has -250 hp,it will show a message to all players.

How?
pawn Код:
if(GetVehicleModel(vehicleid) == 520 || if(GetVehicleModel(vehicleid) == 425))
{
    new Float:health;
    new car;
    car = GetPlayerVehicleID(playerid);
    GetVehicleHealth(car, health)
if{health < 250) return SendClientMessageToAll(COLOR, "Text");
}
Not Tested, Should work.


Re: If vehicle hp... - Face9000 - 07.06.2011

Quote:
Originally Posted by itachi4x4
Посмотреть сообщение
pawn Код:
if(GetVehicleModel(vehicleid) == 520 || if(GetVehicleModel(vehicleid) == 425))
{
    new Float:health;
    new car;
    car = GetPlayerVehicleID(playerid);
    GetVehicleHealth(car, health)
if{health < 250) return SendClientMessageToAll(COLOR, "Text");
}
Not Tested, Should work.
Thanks,where i can place this code? OnPlayerEnterVehicle?


Re: If vehicle hp... - yarrum3 - 07.06.2011

If you put it under OnPlayerEnterVehicle the player will see the message when he hops in the vehicle, And i don't think you can have -250 hp the Vehicle will just blow up and respawn.


Re: If vehicle hp... - Babul - 07.06.2011

if the vehicle has 250 HP when it gets streamed in, it will explode. i presume you want that a player gets his vehicle damaged by another player (250-1000 HP, shot down to <250, then the message)? then
Код:
OnVehicleDamageStatusUpdate
is the callback you need...