Squirrel/Server/Functions/Blips/CreateClientBlip

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|CreateClientBlip}} This function creates a new local radar blip, which is only visible for the player it's created for. It will return a pointer to the blip or '…')
 
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
''CreateClientBlip'' can take 2 different lists of parameters. These are:  
 
''CreateClientBlip'' can take 2 different lists of parameters. These are:  
<code>Blip CreateClientBlip( Player client, int sprite, Vector pos, int colour )</code>
+
<code>Blip CreateClientBlip( Player client, int sprite, Vector pos )</code>
<code>Blip CreateClientBlip( Player client, int sprite, float x, float y, float z, int colour )</code>
+
<code>Blip CreateClientBlip( Player client, int sprite, float x, float y, float z )</code>
  
 
== Arguments ==
 
== Arguments ==
Line 13: Line 13:
 
* '''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
* '''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
 
* '''x''', '''y''', '''z''' - The position of the blip as floats
  
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This commands creates an 8-Ball marker on the radar at player's position.
 +
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
    if ( szCommand == "createblip" )
 +
    {
 +
          CreateClientBlip( pPlayer, BLIP_8BALL, pPlayer.Pos );
 +
    }
 +
   
 +
    return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
Example notes and used functions here.
+
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 22:55, 30 November 2010

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

This function creates a new local radar blip, which is only visible for the player it's created for. It will return a pointer to the blip or null if creating the blip was unsuccessful.

[edit] Syntax

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

  1. Blip CreateClientBlip( Player client, int sprite, Vector pos )
  1. Blip CreateClientBlip( Player client, int sprite, float x, float y, float z )

[edit] Arguments

  • client - The client who will be the owner of this blip and who will be the only one able to see it
  • 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.

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

[edit] Notes

The function Player.Pos 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