isPedChoking | Multi Theft Auto: Wiki Skip to content

isPedChoking

Client-side
Server-side
Shared

Pair: setPedChoking

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function checks if the specified ped is choking (coughing) or not. This happens as a result of weapons that produce smoke - smoke grenades, fire extinguisher and the spray can.

Syntax

isPedChoking ( )

Code Examples

server

This example checks if a random player is choking or not, and if so displays a message in the chat box.

local players = getElementsByType ( "player" )
local randomPlayer = players[math.random(#players)]
if isPedChoking ( randomPlayer ) then
outputChatBox ( getPlayerName ( randomPlayer ) .. " is choking. Keep away from those cigarettes!" )
end

See Also