Squirrel/Server/Functions/Messages/PagerMessage

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Arguments)
(Example)
Line 24: Line 24:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "pager" )
 +
{
 +
if ( szText ) PagerMessage( pPlayer, szText, 140, 1, 2 );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes here
+
The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Messages}}
 
{{Squirrel/Server/Functions/Messages}}

Revision as of 15:50, 29 September 2010

LU This function works in Liberty Unleashed only.

This function shows a GTA pager message to one player or all the players ingame.

Syntax

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

  1. bool PagerMessage( string text, int speed, int something2, int sound )
  1. bool PagerMessage( Player plr, string text, int speed, int something2, int sound3 )

On the speed setting, the lower the number, the faster the message scrolls across, 140 is a good setting.

For sound, the options available are 0, 1 and 2.

Arguments

  • text - This is the message to be sent via the pager
  • speed - This is how quick the message is scrolled across.
  • something2 - Unknown
  • sound - This is what ring tone the pager plays.
  • plr - The pointer of the player the message is meant to

Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "pager" )
  5. {
  6. if ( szText ) PagerMessage( pPlayer, szText, 140, 1, 2 );
  7. }
  8. return 1;
  9. }
  10.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox