Scripting/Squirrel/Functions/Misc/ClientMessage

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 function sends a coloured message to the specified client.

Syntax

bool ClientMessage( string message, Player plr, int r, int g, int b )

Arguments

  • message - The message to send
  • plr - The player to send the mesage to
  • r - The amount of red in the colour
  • g - The amount of green in the colour
  • b - The amount of blue in the colour

Example

This command will send a red message saying 'hello' to the player.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "hello" )
     {
          ClientMessage( "hello!", player, 255, 0, 0 );
     }
}

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
squirrel scripting