Squirrel/Server/Functions/Blips/CreateBlip

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Notes)
Line 16: Line 16:
  
 
== 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" )
+
    if ( szCommand == "createblip" )
{
+
    {
CreateBlip( 0, pPlayer.Pos, 0 );
+
          CreateBlip( BLIP_8BALL, pPlayer.Pos, 0 );
}
+
    }
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 29: Line 33:
 
=== 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/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}}

Revision as of 23:35, 28 September 2010

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

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.

Syntax

CreateBlip can take 2 different lists of parameters. These are:

  1. Blip CreateBlip( int sprite, Vector pos, int colour )
  1. Blip CreateBlip( int sprite, float x, float y, float z, int colour )

Arguments

  • sprite - This is the sprite (icon) of the blip. For reference, check here
  • pos - The position of the blip on radar
  • colour - The colour ID for the blip. These values can be customised in content.xml of the server
  • x, y, z - The position of the blip as floats

Example

This commands creates an 8-Ball marker on the radar at player's position.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "createblip" )
  5. {
  6. CreateBlip( BLIP_8BALL, pPlayer.Pos, 0 );
  7. }
  8. return 1;
  9. }
  10.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox