Squirrel/Server/Functions/Blips/Remove
From Liberty Unleashed Wiki
(Difference between revisions)
(→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 == "removeblip" ) | |
− | + | { | |
− | + | local pBlip = FindBlip( text ? text.tointeger() : 0 ); | |
− | + | if ( pBlip ) pBlip.Remove(); | |
− | + | } | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 24: | Line 28: | ||
=== Notes === | === Notes === | ||
− | The | + | 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
This Blip class method removes the blip.
[edit] Syntax
bool Blip.Remove()
[edit] Arguments
- none
[edit] Example
This example command removes the given blip when someone types '/blip <id>'.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "removeblip" ) { local pBlip = FindBlip( text ? text.tointeger() : 0 ); if ( pBlip ) pBlip.Remove(); } return 1; }
[edit] Notes
The function FindBlip and call onPlayerCommand were used in this example. More info about them in the corresponding pages.