Scripting/Squirrel/Functions/Misc/ClientMessageToAll

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 all clients.

Syntax

bool ClientMessageToAll( string message, int r, int g, int b )

Arguments

  • message - The message to send
  • 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

We will create a custom function for a colour and then call it. I have chosen the red colour.

function Msg( text )
{
  ClientMessageToAll( text, 255, 0, 0 );
}
 
function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "text" )
     {
          Msg( "This is a nice red message!" );
     }
}

Notes

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

Related Functions

Personal tools
squirrel scripting