- Documentation
- Server functions
- isPedAiming
Function
isPedAiming
Checks whether a ped is aiming a weapon (holding the right mouse button or aiming on a gamepad). The state comes from the player's game and refreshes several times per second.
Syntax
bool isPedAiming(ped ped)Arguments
pedped- A player or an NPC.
Returns
true when aiming.
Example
if isPedAiming(player) then outputServerLog(getPlayerName(player) .. " celuje") end
See also
getPedAimTargetReturns the world point a ped is aiming at, as reported by the player's game. Returnsfalsewhen the game has not sent an aim point yet.getPedTargetReturns the element a ped is aiming at (a player, an NPC or a vehicle), as reported by the player's game. Returnsfalsewhen the ped is not aiming at any element.