OnPlayerQuit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
This example does...
This example does...
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
outputDebugString ( "Kills blip when player exits" ) --Outputs to debug console
blabhalbalhb --abababa
function onPlayerQuit () --When the player quits
--This line does this...
destroyBlipsAttachedTo ( source ) --Destorys the blips
mooo
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