Squirrel/Server/Functions/Blips/FindBlip

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Non-player specific)
Line 13: Line 13:
  
 
== Example 1. Non-player specific ==
 
== Example 1. Non-player specific ==
 
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
else if ( szCommand == "find" )
 +
{
 +
local pBlip;
 +
if ( szText ) pBlip = FindBlip( szText.tointeger() );
 +
if ( pBlip ) MessagePlayer( "Found Blip ID " + szText, pPlayer );
 +
}
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
Example notes and used functions here.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in the corresponding pages.
  
 
== Example 2. Player specific ==
 
== Example 2. Player specific ==

Revision as of 19:15, 28 September 2010

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

This function finds a blip from an ID and returns a pointer to it. If there is no such blip, null will be returned.

Syntax

  1. Blip FindBlip( int id [, Player plr ] )

Arguments

  • id - The ID of the blip to be found
  • plr - If the blip you want to find is owned by a specific client, use this to specify the owner. If you don't use this argument the blip will be returned from the global blip pool


Example 1. Non-player specific

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. else if ( szCommand == "find" )
  5. {
  6. local pBlip;
  7. if ( szText ) pBlip = FindBlip( szText.tointeger() );
  8. if ( pBlip ) MessagePlayer( "Found Blip ID " + szText, pPlayer );
  9. }
  10. }
  11.  

Notes

The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.

Example 2. Player specific

This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
  1.  
  2. -- todo
  3.  

Notes

Example notes and used functions here.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox