Squirrel/Server/Functions/Blips/Remove

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 10: Line 10:
  
 
== Example ==
 
== Example ==
 +
 +
This example command removes the given blip when someone types '/blip <id>'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
{
 
{
if ( szCommand == "remove" )
+
    if ( szCommand == "removeblip" )
{
+
    {
local pBlip = FindBlip( 0 );
+
          local pBlip = FindBlip( text ? text.tointeger() : 0 );
if ( pBlip ) pBlip.Remove();
+
          if ( pBlip ) pBlip.Remove();
}
+
    }
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 24: Line 28:
 
=== Notes ===
 
=== Notes ===
  
The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page.
+
The function [[Squirrel/Server/Functions/Blips/FindBlip|FindBlip]] and call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Blips}}
 
{{Squirrel/Server/Functions/Blips}}

Latest revision as of 00:10, 29 September 2010

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

This Blip class method removes the blip.

[edit] Syntax

  1. bool Blip.Remove()

[edit] Arguments

  • none

[edit] Example

This example command removes the given blip when someone types '/blip <id>'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "removeblip" )
  5. {
  6. local pBlip = FindBlip( text ? text.tointeger() : 0 );
  7. if ( pBlip ) pBlip.Remove();
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox