OnPlayerQuit

From Multi Theft Auto: Wiki
Revision as of 20:35, 3 July 2007 by Xanarki (talk | contribs)
Jump to navigation Jump to search

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