setPedChoking | Multi Theft Auto: Wiki Skip to content

setPedChoking

Client-side
Server-side
Shared

Pair: isPedChoking

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 can be used to force the ped to do the choking (coughing) animation until he respawns or toggled off using this function. The animation can not be cancelled by a player it's applied to, and he will not loose health.

Syntax

setPedChoking ( )

Code Examples

server

This script will make all players choke on resource start

-- Choke all the players when the resource starts
function onResourceStart()
setPedChoking(root, true)
end
addEventHandler("onResourceStart", resourceRoot, onResourceStart)
-- Unchoke all the players when the resource stops
function onResourceStop()
setPedChoking(root, false)
end
addEventHandler("onResourceStop", resourceRoot, onResourceStop)
-- Choke players spawning
function onPlayerSpawn()
setPedChoking(source, true)
end
addEventHandler("onPlayerSpawn", root, onPlayerSpawn)

See Also