Vehicle::setDamage: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
Line 1: Line 1:
Apply damage to vehicle at a location. Location is relative to vehicle model (not world).<br><br>Radius of effect damage applied in a sphere at impact location
Apply damage to vehicle at a location. Location is relative to vehicle model (not world).<br><br>Radius of effect damage applied in a sphere at impact location
It is enough to use x,y,z values from -1 to 1.
p6 should be true, with false it does not taking in account offset values and all damage is applied to rear left part of the vehicle.
Good values for radius could be from 25 to 200, for damage 50-200.
You need to apply delay if you want to call setDamage couple times in a row. Typically 10ms is enough.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, p6);</syntaxhighlight>
<syntaxhighlight lang="javascript">vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, p6);</syntaxhighlight>
Line 15: Line 19:
// todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
 
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 17:11, 13 September 2019

Apply damage to vehicle at a location. Location is relative to vehicle model (not world).

Radius of effect damage applied in a sphere at impact location It is enough to use x,y,z values from -1 to 1. p6 should be true, with false it does not taking in account offset values and all damage is applied to rear left part of the vehicle. Good values for radius could be from 25 to 200, for damage 50-200. You need to apply delay if you want to call setDamage couple times in a row. Typically 10ms is enough.

Syntax

vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, p6);

Required Arguments

  • xOffset: float
  • yOffset: float
  • zOffset: float
  • damage: float
  • radius: float
  • p6: Boolean

Return value

  • Undefined

Example

// todo