Squirrel/Server/Functions/Blips/Remove

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 11: Line 11:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This example command removes the given blip when someone types '/blip <id>'.
 +
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
    if ( szCommand == "removeblip" )
 +
    {
 +
          local pBlip = FindBlip( text ? text.tointeger() : 0 );
 +
          if ( pBlip ) pBlip.Remove();
 +
    }
 +
   
 +
    return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
Example notes and used functions here.
+
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