IsPedFrozen

From Multi Theft Auto: Wiki
Revision as of 09:41, 5 August 2009 by Awwu (talk | contribs) (Created page with '__NOTOC__ {{Server client function}} This function retrieves whether the pedestrian is frozen or not. ==Syntax== <syntaxhighlight lang="lua"> bool isPedFrozen ( ped thePed ) </syntaxhighlight> ===Requ…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function retrieves whether the pedestrian is frozen or not.

Syntax

bool isPedFrozen ( ped thePed )

Required Arguments

  • thePed: The ped whose frozen state will be obtained.

Returns

Returns a bool indicating the pedestrians frozen state, or false if invalid arguments were passed.

Example

This example adds a 'togglefreeze' console command that lets players alternate their frozen state.

function toggleFreeze ( sourcePlayer, command )
    local frozen = isPedFrozen ( sourcePlayer )
    setPedFrozen ( sourcePlayer, not frozen )
end
addCommandHandler ( "togglefreeze", toggleFreeze )

See Also