Squirrel/Server/Functions/Blips/CreateBlip
From Liberty Unleashed Wiki
(Difference between revisions)
(→Notes) |
|||
(One intermediate revision by one user not shown) | |||
Line 5: | Line 5: | ||
''CreateBlip'' can take 2 different lists of parameters. These are: | ''CreateBlip'' can take 2 different lists of parameters. These are: | ||
− | <code>Blip CreateBlip( int sprite, Vector pos | + | <code>Blip CreateBlip( int sprite, Vector pos )</code> |
− | <code>Blip CreateBlip( int sprite, float x, float y, float z | + | <code>Blip CreateBlip( int sprite, float x, float y, float z )</code> |
== Arguments == | == Arguments == | ||
Line 12: | Line 12: | ||
* '''sprite''' - This is the sprite (icon) of the blip. For reference, check [[Squirrel/Server/Constants#Radar_Blip_Sprites|here]] | * '''sprite''' - This is the sprite (icon) of the blip. For reference, check [[Squirrel/Server/Constants#Radar_Blip_Sprites|here]] | ||
* '''pos''' - The position of the blip on radar | * '''pos''' - The position of the blip on radar | ||
− | |||
* '''x''', '''y''', '''z''' - The position of the blip as floats | * '''x''', '''y''', '''z''' - The position of the blip as floats | ||
== Example == | == Example == | ||
+ | |||
+ | This commands creates an 8-Ball marker on the radar at player's position. | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
function onPlayerCommand( pPlayer, szCommand, szText ) | function onPlayerCommand( pPlayer, szCommand, szText ) | ||
{ | { | ||
− | + | if ( szCommand == "createblip" ) | |
− | + | { | |
− | + | CreateBlip( BLIP_8BALL, pPlayer.Pos ); | |
− | + | } | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 29: | Line 32: | ||
=== Notes === | === Notes === | ||
− | The | + | The function [[Squirrel/Server/Functions/Players/Pos|Player.Pos]] 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 17:59, 28 October 2010
This function creates a new global radar blip, which is visible for everyone. It will return a pointer to the blip or null if creating the blip was unsuccessful.
[edit] Syntax
CreateBlip can take 2 different lists of parameters. These are:
Blip CreateBlip( int sprite, Vector pos )
Blip CreateBlip( int sprite, float x, float y, float z )
[edit] Arguments
- sprite - This is the sprite (icon) of the blip. For reference, check here
- pos - The position of the blip on radar
- x, y, z - The position of the blip as floats
[edit] Example
This commands creates an 8-Ball marker on the radar at player's position.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "createblip" ) { CreateBlip( BLIP_8BALL, pPlayer.Pos ); } return 1; }
[edit] Notes
The function Player.Pos and call onPlayerCommand were used in this example. More info about them in the corresponding pages.