Squirrel/Server/Functions/Blips/Remove
From Liberty Unleashed Wiki
(Difference between revisions)
m (moved Squirrel/Functions/Blips/Remove to Squirrel/Server/Functions/Blips/Remove: Server-side function) |
|||
(One intermediate revision by one user not shown) | |||
Line 11: | Line 11: | ||
== 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 ) | |
+ | { | ||
+ | if ( szCommand == "removeblip" ) | ||
+ | { | ||
+ | local pBlip = FindBlip( text ? text.tointeger() : 0 ); | ||
+ | if ( pBlip ) pBlip.Remove(); | ||
+ | } | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | 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.