Scripting/Squirrel/Events/Player/onPlayerTeamKill
From VC-MP Wiki
NOTE: This function has been modified in VC:MP 0.3z r2. It may work as in previous versions, and offer additional functionality.
This is called when a player kills another player from the same team.
Note: An additional bodypart argument was added to the event for 0.3z R2.
Syntax
function onPlayerTeamKill( killer, player, reason, bodypart )
Parameters
- killer - The pointer of the killer
- player - The pointer of the player
- reason - The weapon id
- bodypart - Bodypart ID
Example
This will message the chat when a player team-kills another player.
function onPlayerTeamKill( killer, player, reason, bodypart ) { Message( "**** " + killer.Name + " team-killed " + player.Name " (" + GetWeaponName( reason ) + ")" ); }
Notes
The functions Message, player.Name and GetWeaponName 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
