SetPlayerFightingStyle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">setPlayerFightingStyle ( player, int style ) </syntaxhighlight> | <syntaxhighlight lang="lua">setPlayerFightingStyle ( player thePlayer, int style ) </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''thePlayer:''' 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== | ==Example== | ||
Line 37: | Line 37: | ||
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"> | ||
function consoleSetFightingStyle ( | function consoleSetFightingStyle ( thePlayer, commandName, id ) | ||
if ( | if ( thePlayer and id ) then -- If player and ID are specified | ||
local status = setPlayerFightingStyle ( thePlayer, tonumber(id) ) -- set the fighting style | |||
if ( not status ) then -- | if ( not status ) then -- if that failed | ||
outputConsole ( "Failed to set fighting style.", | outputConsole ( "Failed to set fighting style.", thePlayer ) -- show a message | ||
end | end | ||
end | end |
Revision as of 11:05, 16 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 thePlayer, int style )
Required Arguments
- thePlayer: 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 [-]
ServerThis 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 = setPlayerFightingStyle ( 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
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState