Difference between revisions of "DAMAGE CHAR"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with "{{Native |np=2 |p1t=Handle |p1d=Ped Handle |p2t=int |p2d=damage? }} The results of this function are either unknown or untested.")
 
m
 
Line 1: Line 1:
 
{{Native
 
{{Native
|np=2
+
|np=3
 
|p1t=Handle
 
|p1t=Handle
 
|p1d=Ped Handle
 
|p1d=Ped Handle
|p2t=int
+
|p2t=uint
|p2d=damage?
+
|p2d=hit_points
 +
|p3t=bool(?)
 +
|p3d=unknown
 
}}
 
}}
  
The results of this function are either unknown or untested.
+
== Description ==
 +
 
 +
Subtracts ''hit_points'' from the health of a ped.
 +
 
 +
 
 +
== Example ==
 +
 
 +
<source lang="cpp">
 +
 
 +
if(IsGameKeyboardKeyPressed(20))
 +
{
 +
//It doesn't matter if the last parameter is 0 or 1.
 +
//This may indicate that the last parameter is not of type bool
 +
//or that it isn't used in the function.
 +
DamageChar(niko, 20, 0);
 +
}
 +
 
 +
 
 +
</source>

Latest revision as of 13:00, 8 January 2015

DAMAGE_CHAR
Number of parameters: 3
Parameter #TypeDescription
1.HandlePed Handle
2.uinthit_points
3.bool(?)unknown
Return value:
TypeDescription
None

Description

Subtracts hit_points from the health of a ped.


Example

if(IsGameKeyboardKeyPressed(20))
	{
		//It doesn't matter if the last parameter is 0 or 1.
		//This may indicate that the last parameter is not of type bool
		//or that it isn't used in the function.
		DamageChar(niko, 20, 0);
	}