GetVehicleHealth....How? - 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: GetVehicleHealth....How? (
/showthread.php?tid=333649)
GetVehicleHealth....How? -
Gooday - 12.04.2012
I would make a script:
IF Vehicle health = 400, SetVehicleHealth 500
But where to add? and how to make?
(It basically don't make explode the car...)
Re: GetVehicleHealth....How? -
Ironboy - 12.04.2012
pawn Код:
if(strcmp(cmdtext, "/repair", true) == 0)
{
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health >400) return SendClientMessage(playerid,COLOR_RED,"Doesn't need repairing!");
SetVehicleHealth(veh,500);
SendClientMessage(playerid,COLOR_GREEN,"Repaired!");
}
Re: GetVehicleHealth....How? -
Gooday - 12.04.2012
I won't a command I would like include this "automatically" when a car has 300HP..
Re: GetVehicleHealth....How? -
sabretur - 12.04.2012
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,hp);
if(hp < 400) SetVehicleHealth(vehicleid,500);
}
return 1;
}
Re: GetVehicleHealth....How? -
DBan - 12.04.2012
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
I'm guessing?
Re: GetVehicleHealth....How? -
[LoF]Zak - 12.04.2012
Quote:
Originally Posted by DBan
|
On that page:
Note: This does not include vehicle health changes
Lol.
Re: GetVehicleHealth....How? -
DBan - 12.04.2012
Quote:
Originally Posted by [LoF]Zak
On that page:
Note: This does not include vehicle health changes
Lol.
|
xD Didn't see that