SetVehicleHealth
From SA-MP Wiki
(Difference between revisions)
Revision as of 16:49, 19 August 2013 Smithy (Talk | contribs) ← Previous diff |
Revision as of 22:43, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 32: | Line 32: | ||
[[de:SetVehicleHealth]] | [[de:SetVehicleHealth]] | ||
+ | [[fr:SetVehicleHealth]] | ||
[[nl:SetVehicleHealth]] | [[nl:SetVehicleHealth]] |
Revision as of 22:43, 31 January 2014
Description:
Sets a vehicle's health to a specific value
(vehicleid, Float:health)
vehicleid | ID of the vehicle to set the health of. |
Float:health | Health given as a float value. |
Return Values:
This function does not return any specific values.
Note | Full vehicle health is 1000. For more information on health values, see this page. |
if(strcmp("/fixengine", cmdtext, true) == 0) { new vehicleid = GetPlayerVehicleID(playerid); SetVehicleHealth(vehicleid, 1000); SendClientMessage(playerid, COLOUR_WHITE, "The vehicles engine has been fully repaired."); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetVehicleHealth: Check the health of a vehicle.
- RepairVehicle: Fully repair a vehicle.
- SetPlayerHealth: Set a player's health.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnVehicleDeath: Called when a vehicle is destroyed.