Squirrel/Server/Functions/Sounds/PlaySuspectLastSeen

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|PlaySuspectLastSeen}} This function plays a 'suspect last seen' message. == Syntax == <code>bool PlaySuspectLastSeen( player plr, Vector pos )</code> <code>boo…')
 
 
Line 15: Line 15:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This code will play the "suspect last seen" message when they use the '/lastseen' command.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- Todo
+
function onPlayerCommand( player, cmd, text )
 +
{
 +
    if( cmd == "lastseen" )
 +
    {
 +
          PlaySuspectLastSeen(player, player.Pos);
 +
    }
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about them in corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Sounds}}
 
{{Squirrel/Server/Functions/Sounds}}

Latest revision as of 14:03, 31 July 2011

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

This function plays a 'suspect last seen' message.

[edit] Syntax

  1. bool PlaySuspectLastSeen( player plr, Vector pos )
  1. bool PlaySuspectLastSeen( player plr, float x, float y, float z )

[edit] Arguments

  • plr - The player to play the sound for
  • pos - The position of where the suspect was last seen
  • x, y, z - The position of where the suspect was last seen as floats

[edit] Example

This code will play the "suspect last seen" message when they use the '/lastseen' command.

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

[edit] Notes

The event onPlayerCommand was used in this example. More info about them in corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox