Squirrel/Server/Functions/Messages/ClearMessages

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 2)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|ClearMessages}}
 
This function clears all the GTA messages currently on screen. This can be used for one player or for all players.
 
This function clears all the GTA messages currently on screen. This can be used for one player or for all players.
  

Latest revision as of 11:00, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function clears all the GTA messages currently on screen. This can be used for one player or for all players.

[edit] Syntax

ClearMessages can take 2 different lists of parameters. These are:

  1. bool ClearMessages()
  1. bool ClearMessages( Player plr )

[edit] Arguments

  • plr - The pointer to the player whose messages should be cleared

[edit] Example 1

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "clearmsg" )
  5. {
  6. ClearMessages( );
  7. }
  8. }
  9.  

This command will clear all GTA messages for all players.

[edit] Example 2

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "clearmsg" )
  5. {
  6. ClearMessages( player );
  7. }
  8. }
  9.  

This command will clear all GTA messages for the command user.

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox