SetPedFightingStyle: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Shared function}} | ||
Changes a ped's fighting style. Most styles only change the 'special attack' which is done using the Aim and Enter keys. | Changes a ped's fighting style. Most styles only change the 'special attack' which is done using the Aim and Enter keys. | ||
{{New feature/item|3.0160|1.5.7||Function also added client-side.}} | |||
==Syntax== | ==Syntax== |
Revision as of 17:39, 2 September 2019
Changes a ped's fighting style. Most styles only change the 'special attack' which is done using the Aim and Enter keys. Function also added client-side.
Syntax
bool setPedFightingStyle ( ped thePed, int style )
Required Arguments
- thePed: The ped whose fighting style to change.
- style: The fighting style ID to apply.
Fighting Styles:
Fighting Style | ID |
STYLE_STANDARD | 4 |
STYLE_BOXING | 5 |
STYLE_KUNG_FU | 6 |
STYLE_KNEE_HEAD | 7 |
STYLE_GRAB_KICK | 15 |
STYLE_ELBOWS | 16 |
Returns
Returns true in case of success, false otherwise.
Example
This example sets the player's fighting style to the desired style when he types "setstyle" followed by a number from 4 to 16 in console.
function consoleSetFightingStyle ( thePlayer, commandName, id ) if thePlayer and id then -- If player and ID are specified local status = setPedFightingStyle ( thePlayer, tonumber(id) ) -- set the fighting style if not status then -- if that failed outputConsole ( "Failed to set fighting style.", thePlayer ) -- show a message end end end addCommandHandler ( "setstyle", consoleSetFightingStyle )
See Also
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle