Squirrel/Client/Functions/Messages/SmallMessage

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Notes)
(Example)
 
Line 21: Line 21:
 
if ( cmd == "smallmsg" )
 
if ( cmd == "smallmsg" )
 
{
 
{
if ( text ) SmallMessage ( "Hi! :)", 5000, 1 );
+
if ( szParams ) SmallMessage ( "Hi! :)", 5000, 1 );
 
}
 
}
  

Latest revision as of 12:48, 12 November 2013

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

This function sends a small GTA style text to the client.

[edit] Syntax

SmallMessage has an parameter.

  1. bool SmallMessage( string text, int time, int type )

[edit] Arguments

  • text - This is the message to send to players
  • time - This is how long the message will stay on screen
  • type - The type of the announcement message

[edit] Example

  1.  
  2. function onClientCommand ( szCommand, szParams )
  3. {
  4. if ( cmd == "smallmsg" )
  5. {
  6. if ( szParams ) SmallMessage ( "Hi! :)", 5000, 1 );
  7. }
  8.  
  9. return 1;
  10. }
  11.  

This command will show a small message, with type 0, lasting 5 seconds, showing the specified text, for the command user.

[edit] Notes

The call onClientCommand 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