Difference between revisions of "IsPedFrozen"

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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…')
 
m (Visual improvement)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{Server client function}}
 
{{Server client function}}
 +
{{Deprecated|isElementFrozen}}
 +
 
This function retrieves whether the pedestrian is frozen or not.
 
This function retrieves whether the pedestrian is frozen or not.
  
Line 17: Line 19:
 
This example adds a 'togglefreeze' console command that lets players alternate their frozen state.
 
This example adds a 'togglefreeze' console command that lets players alternate their frozen state.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
function toggleFreeze ( sourcePlayer, command )
+
function toggleFreeze ( sourcePlayer )
    local frozen = isPedFrozen ( sourcePlayer )
+
     setPedFrozen ( sourcePlayer, not isPedFrozen ( sourcePlayer ) )
     setPedFrozen ( sourcePlayer, not frozen )
 
 
end
 
end
 
addCommandHandler ( "togglefreeze", toggleFreeze )
 
addCommandHandler ( "togglefreeze", toggleFreeze )

Latest revision as of 11:42, 26 June 2014

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use isElementFrozen instead.


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 )
    setPedFrozen ( sourcePlayer, not isPedFrozen ( sourcePlayer ) )
end
addCommandHandler ( "togglefreeze", toggleFreeze )

See Also