SetPlayerFightingStyle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 33: Line 33:
*'''Style:''' A whole integer specifying the style of fighting you want to give to the player
*'''Style:''' A whole integer specifying the style of fighting you want to give to the player


==Example==   
==Example==
<section name="Server" class="server" show="true">  
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.
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.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 46: Line 47:
addCommandHandler ( "setstyle",  consoleSetFightingStyle )
addCommandHandler ( "setstyle",  consoleSetFightingStyle )


</syntaxhighlight>
</syntaxhighlight> </section>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}
{{Server function}}

Revision as of 23:10, 14 August 2007

Changes a player's fighting style, most only change the 'special attack' which is done using the Aim and Enter keys.

Fighting Style ID
STYLE_STANDARD 4
STYLE_BOXING 5
STYLE_KUNG_FU 6
STYLE_KNEE_HEAD 7
STYLE_GRAB_KICK 15
STYLE_ELBOWS 16

Syntax

setPlayerFightingStyle ( player, int style ) 

Required Arguments

  • Player: Tells the function to give the fighting style to a player
  • Style: A whole integer specifying the style of fighting you want to give to the player

Example

Click to collapse [-]
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 ( player, commandName, id ) --Calls the function
	if ( player and id ) then --If both are valid
	    local status = setPlayerFightingStyle ( player, tonumber(id) ) --Fighting style is set
		if ( not status ) then --If it can't set the fighting style (bad ID)
			outputConsole ( "Failed to set fighting style.", player ) --This shows
		end
	end
end
addCommandHandler ( "setstyle",  consoleSetFightingStyle )

See Also

Shared