onPlayerAction
From Liberty Unleashed Wiki
This is called when a player sends a /me action to the chat. This event is still called if the player is muted.
Syntax
function onPlayerAction( Player player, string message )
Arguments
- player - The player pointer
- message - The "action" that the player did with /me
Returns
- 1 - Send the action message to other clients, unless they're muted
- 0 - Returning 0 will cancel this message and mute the player
Example
This example will kill the player if/when they type /me died.
function onPlayerAction( player, text ) { if ( text == "died" ) { // Kill the player >:D player.Health = 0; MessagePlayer( "You asked for it", player ); } return 1; }
Notes
The functions MessagePlayer and Player.Health were used in this example. More info about them can be found in the corresponding pages.
Related Events
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange