getPedFightingStyle | Multi Theft Auto: Wiki Skip to content

getPedFightingStyle

Client-side
Server-side
Shared

Pair: setPedFightingStyle

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Retrieves the fighting style a player/ped is currently using. Function also added client-side.

OOP Syntax Help! I don't understand this!

  • Method:ped:getFightingStyle(...)
  • Variable: .fightingStyle

Syntax

int getPedFightingStyle ( ped thePed )
Required Arguments
  • thePed: the ped whose current fighting style ID you wish to retrieve.

Returns

  • int: value

Returns the ped's current fighting style as an integer ID, false if it fails to retrieve a value.

Code Examples

shared

This will allow any player to check what fighting style they are currently using, by typing the 'getfightingstyle' command.

function getPlayerFightStyle ( thePlayer, commandName )
local playerstyle = getPedFightingStyle ( thePlayer ) -- store the fighting style in a variable
outputChatBox ( tostring(playerstyle), thePlayer ) -- output it to the player
end
addCommandHandler ( "getfightingstyle", getPlayerFightStyle )

See Also