setPedFightingStyle | Multi Theft Auto: Wiki Skip to content

setPedFightingStyle

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


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

setPedFightingStyle ( )

Code Examples

server

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