Scripting/Squirrel/Events/Player/onPlayerVersion

From VC-MP Wiki

Jump to: navigation, search

NOTE: This function has been added in VC:MP 0.3z r2. It will not work in previous versions.


This event is called when a player joins the server and sends the server their client version number.

Syntax

function onPlayerVersion( player, version )

Parameters

  • player - The pointer of the player
  • version - Player's client version

Example

This script will notice a player, when he joins, if his client is outdated or not... Current VC-MP build from 17.01.2010 is version "2".

function onPlayerVersion( player, version )
{
     if ( version != 2 ) MessagePlayer( "Your client is outdated! Go and download a new version...", player );
     else MessagePlayer( "You have the latest VC-MP version, welcome on the server!", player );
}

Notes

  • In some servers you can be kicked for using an outdated VC-MP build. New builds contain for example new scripting stuff that will now work on the old builds like vehicle.Remove()...
  • Change the "2" in "version != 2" if there will be a new VC-MP version.
  • The function MessagePlayer was used in in this example. More info about them in corresponding pages.

Related Events

Personal tools
squirrel scripting