Ped::getClosestPed: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
 
Line 1: Line 1:
Gets the closest ped in a radius.<br><br>Ped Types:<br>Any ped = -1<br>Player = 1<br>Male = 4 <br>Female = 5 <br>Cop = 6<br>Human = 26<br>SWAT = 27 <br>Animal = 28<br>Army = 29<br><br>------------------<br>P4 P5 P7 P8<br>1  0  x  x  = return nearest walking Ped<br>1  x  0  x  = return nearest walking Ped<br>x  1  1  x  = return Ped you are using<br>0  0  x  x  = no effect<br>0  x  0  x  = no effect<br><br>x = can be 1 or 0. Does not have any obvious changes.<br><br>This function does not return ped who is:<br>1. Standing still<br>2. Driving<br>3. Fleeing<br>4. Attacking<br><br>This function only work if the ped is:<br>1. walking normally.<br>2. waiting to cross a road.<br><br>Note: PED::GET_PED_NEARBY_PEDS works for more peds.
Gets the closest ped in a radius.<br><br>Ped Types:<br>Any ped = -1<br>Player = 1<br>Male = 4 <br>Female = 5 <br>Cop = 6<br>Human = 26<br>SWAT = 27 <br>Animal = 28<br>Army = 29<br><br>------------------<br>P4 P5 P7 P8<br>1  0  x  x  = return nearest walking Ped<br>1  x  0  x  = return nearest walking Ped<br>x  1  1  x  = return Ped you are using<br>0  0  x  x  = no effect<br>0  x  0  x  = no effect<br><br>x = can be 1 or 0. Does not have any obvious changes.<br><br>This function does not return ped who is:<br>1. Standing still<br>2. Driving<br>3. Fleeing<br>4. Attacking<br><br>This function only work if the ped is:<br>1. walking normally.<br>2. waiting to cross a road.<br><br>Note: PED::GET_PED_NEARBY_PEDS works for more peds.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">ped.getClosestPed(x, y, z, radius, p4, p5, outPed, p7, p8, pedType);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.ped.getClosestPed(x, y, z, radius, p4, p5, outPed, p7, p8, pedType);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''x:''' float
*'''x:''' float
Line 17: Line 17:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Ped_function_c}}
{{Ped_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 21:29, 6 May 2017

Gets the closest ped in a radius.

Ped Types:
Any ped = -1
Player = 1
Male = 4
Female = 5
Cop = 6
Human = 26
SWAT = 27
Animal = 28
Army = 29

------------------
P4 P5 P7 P8
1 0 x x = return nearest walking Ped
1 x 0 x = return nearest walking Ped
x 1 1 x = return Ped you are using
0 0 x x = no effect
0 x 0 x = no effect

x = can be 1 or 0. Does not have any obvious changes.

This function does not return ped who is:
1. Standing still
2. Driving
3. Fleeing
4. Attacking

This function only work if the ped is:
1. walking normally.
2. waiting to cross a road.

Note: PED::GET_PED_NEARBY_PEDS works for more peds.

Syntax

mp.game.ped.getClosestPed(x, y, z, radius, p4, p5, outPed, p7, p8, pedType);

Required Arguments

  • x: float
  • y: float
  • z: float
  • radius: float
  • p4: Boolean
  • p5: Boolean
  • outPed: Ped
  • p7: Boolean
  • p8: Boolean
  • pedType: int

Return value

  • Ped

Example

// todo

See also