OnPlayerQuit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Incomplete Event]]
__NOTOC__  
__NOTOC__  
This event is triggered when a player leaves the game, for whatever reason.
This event is triggered when a player leaves the game, for whatever reason.

Revision as of 20:35, 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