Scripting/Squirrel/Functions/Misc/AnnounceAll

From VC-MP Wiki

Jump to: navigation, search

NOTE: This function has been modified in VC:MP 0.3z r2. It may work as in previous versions, and offer additional functionality.


Sends an on-screen message to everybody. Note: An optional style argument has been added to the function for R2. This will either show an announce message in the middle of the screen (style 0) or the bottom of the screen (style 1).

Syntax

bool AnnounceAll( string Message [, iStyle ] )

Arguments

  • Message - The message to send
  • iStyle - Announcement style - either 0 or 1

Example

When a player types '/c moo', the announce "moo!" will be send to all players

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "moo" )
     {
          AnnounceAll( "moo!", 1 );
          MessagePlayer( "Happy now?", player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting