Scripting/Squirrel/Events/Player/onPlayerChat
From VC-MP Wiki
This is called when a player speaks in the main chat. This is called even if the player is muted.
Syntax
function onPlayerChat( player, message )
Parameters
- player - The pointer of the player
- message - The message player said
Example
This example checks if the player has been muted and reminds them if they have.
function onPlayerChat( player, text ) { if ( player.IsMuted ) { MessagePlayer( "You are currently muted so nobody can hear you.", player ); } }
Notes
The functions MessagePlayer and player.IsMuted were used in in this example. More info about them in corresponding pages.
Related Events
- onPlayerJoin
- onPlayerPart
- onPlayerCrashDump
- onPlayerSpawn
- onPlayerDeath
- onPlayerKill
- onPlayerTeamKill
- onPlayerChat
- onPlayerAction
- onPlayerPM
- onPlayerFailedPM
- onPlayerTeamChat
- onPlayerCommand
- onPlayerHealthChange
- onPlayerArmourChange
- onPlayerWeaponChange
- onPlayerCashChange
- onPlayerScoreChange
- onPlayerKeyStateChange
- onPlayerMove
- onPlayerRequestClass
- onPlayerRequestAmmunation
- onPlayerRequestAmmuWeapon
- onPlayerStartSpectating
- onPlayerExitSpectating
- onPlayerRconLogin
- onPlayerRconLoginAttempt
- onPlayerFall
- onPlayerVersion
