OnPlayerPart: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
No edit summary
Line 22: Line 22:
=== Notes ===
=== Notes ===


The functions [[Scripting/Squirrel/Functions/Message|Message]] and [[Scripting/Squirrel/Functions/player.Name|player.Name]] were used in this example. More info about them in corresponding pages.
The functions [[Scripting/Squirrel/Functions/Message|Message]] and [[Scripting/Squirrel/Functions/Player.Name|Player.Name]] were used in this example. More info about them in corresponding pages.


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Events/Player_Events}}
{{Scripting/Squirrel/Events/Player_Events}}

Revision as of 23:33, 29 July 2014

This is called when a player disconnects from the server.

Syntax

function onPlayerPart( player, reason )

Arguments

  • player - The pointer of the player
  • reason - Reason ID for the part.

Example

In this example the server will send a message when a player leaves the server.

function onPlayerPart( player, reason )
{
    Message( player.Name + " left server." );    
}

Notes

The functions Message and Player.Name were used in this example. More info about them in corresponding pages.

Related Functions