SetBlipOrdering: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function jaja(thePlayer) | function jaja(thePlayer) | ||
setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0, | setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0,99999.0,getRootElement()) | ||
setBlipOrdering(setmeup, getBlipOrdering(setmeup) + 1) | setBlipOrdering(setmeup, getBlipOrdering(setmeup) + 1) | ||
outputChatBox("*INFO: #ffff00Your blip is now on top of others!", thePlayer, 255,0,0,true) | outputChatBox("*INFO: #ffff00Your blip is now on top of others!", thePlayer, 255,0,0,true) |
Revision as of 16:56, 5 March 2011
This function sets the Z ordering of a blip. It allows you to make a blip appear on top of or below other blips.
Syntax
bool setBlipOrdering ( blip theBlip, int ordering )
Required Arguments
- theBlip: the blip whose Z ordering to change.
- ordering: the new Z ordering value. Blips with higher values will appear on top of blips with lower values. The default value is 0. Negative values are allowed.
Returns
Returns true if the blip ordering was changed successfully, false otherwise.
Example
This example will create a blip and make your blip on top of all other blip's.
Click to collapse [-]
Serverfunction jaja(thePlayer) setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0,99999.0,getRootElement()) setBlipOrdering(setmeup, getBlipOrdering(setmeup) + 1) outputChatBox("*INFO: #ffff00Your blip is now on top of others!", thePlayer, 255,0,0,true) for i,v in ipairs getElementsByType("player") do if v ~= thePlayer then outputChatBox("*INFO: #ffff00" .. getPlayerName(thePlayer) .. "'s blip is now on top of your blip!", v, 255,0,0,true) end addCommandHandler("ilovemyblip", jaja)