Squirrel/Server/Functions/Blips/CreateBlip
From Liberty Unleashed Wiki
(Difference between revisions)
m (moved Squirrel/Functions/Blips/CreateBlip to Squirrel/Server/Functions/Blips/CreateBlip: Server-side function) |
(→Example) |
||
Line 19: | Line 19: | ||
{{Squirrel/NeedsExample}} | {{Squirrel/NeedsExample}} | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "createblip" ) | ||
+ | { | ||
+ | CreateBlip( 0, pPlayer.Pos, 0 ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The function event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were 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 18:57, 28 September 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.
Syntax
CreateBlip can take 2 different lists of parameters. These are:
Blip CreateBlip( int sprite, Vector pos, int colour )
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 function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "createblip" ) { CreateBlip( 0, pPlayer.Pos, 0 ); } }
Notes
The function event onPlayerCommand were used in in this example. More info about this in the corresponding page.