Squirrel/Server/Functions/Blips/CreateClientBlip
From Liberty Unleashed Wiki
(Difference between revisions)
m (moved Squirrel/Functions/Blips/CreateClientBlip to Squirrel/Server/Functions/Blips/CreateClientBlip: Server-side function) |
(→Example) |
||
Line 18: | Line 18: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "createblip" ) | ||
+ | { | ||
+ | CreateClientBlip( pPlayer, 0, pPlayer.Pos, 0 ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Blips}} | {{Squirrel/Server/Functions/Blips}} |
Revision as of 19:01, 28 September 2010
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.
Syntax
CreateClientBlip can take 2 different lists of parameters. These are:
Blip CreateClientBlip( Player client, int sprite, Vector pos, int colour )
Blip CreateClientBlip( Player client, int sprite, float x, float y, float z, int colour )
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
- 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
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "createblip" ) { CreateClientBlip( pPlayer, 0, pPlayer.Pos, 0 ); } }
Notes
The event onPlayerCommand was used in in this example. More info about this in the corresponding page.