Difference between revisions of "Lua:player killed"
From Fortress Forever Wiki
Jump to navigationJump to searchm |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Infobox manual/Header}} | {{Infobox manual/Header}} | ||
+ | {{Infobox mapping}} | ||
==player_killed(player_id, damageinfo)== | ==player_killed(player_id, damageinfo)== | ||
This function is called whenever a player dies. | This function is called whenever a player dies. | ||
Line 20: | Line 21: | ||
</pre> | </pre> | ||
− | [[Category:Lua | + | [[Category:Lua Callbacks]][[Category:Global Callbacks]] |
{{Infobox manual/Footer}} | {{Infobox manual/Footer}} |
Latest revision as of 21:04, 28 June 2009
player_killed(player_id, damageinfo)This function is called whenever a player dies. Inputs
ExampleHere's an example if you wanted to give your team a point when you killed someone not on your team: The global variable "killer" will be set, which contains the player that killed this player. function player_killed( player_id ) -- If you kill someone, give your team a point if GetPlayerTeam( killer ) then if not ( GetPlayerTeam( player_id ) == GetPlayerTeam( killer ) ) then AddTeamScore( GetPlayerTeam( killer ), 1 ) end end end |