OnPlayerQuit: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
|||
Line 12: | Line 12: | ||
This example does... | This example does... | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | outputDebugString ( "Kills blip when player exits" ) --Outputs to debug console | ||
function onPlayerQuit () --When the player quits | |||
-- | destroyBlipsAttachedTo ( source ) --Destorys the blips | ||
removePlayerFromTeam ( source ) --Also removes player from the previously selected team | |||
end | |||
addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) --The event | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 20:34, 3 July 2007
This event is triggered when a player leaves the game, for whatever reason.
Syntax
void [[onPlayerQuit]] ( string reason )
Example
This example does...
outputDebugString ( "Kills blip when player exits" ) --Outputs to debug console function onPlayerQuit () --When the player quits destroyBlipsAttachedTo ( source ) --Destorys the blips removePlayerFromTeam ( source ) --Also removes player from the previously selected team end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) --The event