Squirrel/Server/Functions/Messages/SmallMessage
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|SmallMessage}} | |
This function sends a small GTA style text to a player or all the players in the game. | This function sends a small GTA style text to a player or all the players in the game. | ||
Latest revision as of 11:00, 11 October 2010
This function sends a small GTA style text to a player or all the players in the game.
[edit] Syntax
SmallMessage can take 2 different lists of parameters. These are:
bool SmallMessage( string text, int time, int type )
bool SmallMessage( Player plr, 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
- plr - The pointer to the player who should get the message
[edit] Example 1
function onPlayerCommand( player, cmd, text ) { if ( cmd == "smallmsg" ) { if ( text ) SmallMessage( text, 5000, 1 ); } }
This command will show a small message, with type 0, lasting 5 seconds, showing the specified text, for all players.
[edit] Example 2
function onPlayerCommand( player, cmd, text ) { if ( cmd == "smallmsg" ) { if ( text ) SmallMessage( player, text, 5000, 1 ); } }
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 onPlayerCommand was used in in this example. More info about this in the corresponding page.