SetPedWalkingStyle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{New feature/item|4.0140|1.3.1|4935|
Sets the walking style of a ped. A walking style consists of a set of animations that are used for walking, running etc.
Sets the walking style of a ped. A walking style consists of a set of animations that are used for walking, running etc.
}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool setPedWalkingStyle ( ped thePed, int style )</syntaxhighlight>
<syntaxhighlight lang="lua">bool setPedWalkingStyle ( ped thePed, int style )</syntaxhighlight>
 
{{OOP||[[Ped|ped]]:setWalkingStyle|walkingStyle|getPedWalkingStyle}}
===Required Arguments===
===Required Arguments===
*'''thePed:''' the ped whose walking style to change.
*'''thePed:''' the ped whose walking style to change.
Line 18: Line 16:
===Returns===
===Returns===
Returns ''true'' if successful, ''false'' otherwise.
Returns ''true'' if successful, ''false'' otherwise.
==Example==
<section name="Client example" class="client" show="true">
Changes the walking style of the player to Drunkman when the resource is started
<syntaxhighlight lang="lua">
function onClientResourceStart()
setPedWalkingStyle(localPlayer,126)
end
addEventHandler("onClientResourceStart",resourceRoot, onClientResourceStart)
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Ped functions}}
{{Ped functions}}

Latest revision as of 16:34, 11 April 2015

Sets the walking style of a ped. A walking style consists of a set of animations that are used for walking, running etc.

Syntax

bool setPedWalkingStyle ( ped thePed, int style )

OOP Syntax Help! I don't understand this!

Method: ped:setWalkingStyle(...)
Variable: .walkingStyle
Counterpart: getPedWalkingStyle


Required Arguments

  • thePed: the ped whose walking style to change.
  • style: the walking style to set.

The possible walking styles are:

MOVE_DEFAULT 0
MOVE_PLAYER 54
MOVE_PLAYER_FAT 55
MOVE_PLAYER_MUSCULAR 56
MOVE_ROCKET 57
MOVE_ROCKET_FAT 58
MOVE_ROCKET_MUSCULAR 59
MOVE_ARMED 60
MOVE_ARMED_FAT 61
MOVE_ARMED_MUSCULAR 62
MOVE_BASEBALLBAT 63
MOVE_BASEBALLBAT_FAT 64
MOVE_BASEBALLBAT_MUSCULAR 65
MOVE_CHAINSAW 66
MOVE_CHAINSAW_FAT 67
MOVE_CHAINSAW_MUSCULAR 68
MOVE_SNEAK 69
MOVE_JETPACK 70
MOVE_MAN 118
MOVE_SHUFFLE 119
MOVE_OLDMAN 120
MOVE_GANG1 121
MOVE_GANG2 122
MOVE_OLDFATMAN 123
MOVE_FATMAN 124
MOVE_JOGGER 125
MOVE_DRUNKMAN 126
MOVE_BLINDMAN 127
MOVE_SWAT 128
MOVE_WOMAN 129
MOVE_SHOPPING 130
MOVE_BUSYWOMAN 131
MOVE_SEXYWOMAN 132
MOVE_PRO 133
MOVE_OLDWOMAN 134
MOVE_FATWOMAN 135
MOVE_JOGWOMAN 136
MOVE_OLDFATWOMAN 137
MOVE_SKATE 138

Returns

Returns true if successful, false otherwise.

Example

Click to collapse [-]
Client example

Changes the walking style of the player to Drunkman when the resource is started

function onClientResourceStart()
	setPedWalkingStyle(localPlayer,126) 
end
addEventHandler("onClientResourceStart",resourceRoot, onClientResourceStart)

See Also