SetBlipOrdering: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
m (Link to the Romanian translation of this page added.) |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setBlipOrdering ( blip theBlip, int ordering )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setBlipOrdering ( blip theBlip, int ordering )</syntaxhighlight> | ||
{{OOP||[[blip]]:setOrdering|ordering|getBlipOrdering|}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theBlip:''' the blip whose Z ordering to change. | *'''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. | *'''ordering:''' the new Z ordering value. Blips with higher values will appear on top of blips with lower values. Possible range: -32767 to 32767. Default: 0. | ||
===Returns=== | ===Returns=== | ||
Line 17: | Line 17: | ||
<section class="server" name="Server" show="true"> | <section class="server" name="Server" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function makeBlipHigher(thePlayer) | ||
setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0,99999.0, | local setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0,99999.0, root) | ||
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) | ||
for i,v in ipairs getElementsByType | for i,v in ipairs(getElementsByType"player") do | ||
if v ~= thePlayer then | if v ~= thePlayer then | ||
outputChatBox("*INFO: #ffff00" .. getPlayerName(thePlayer) .. "'s blip is now on top of your blip!", v, | outputChatBox("*INFO: #ffff00" .. getPlayerName(thePlayer) .. "'s blip is now on top of your blip!",v,255,0,0,true) | ||
255,0,0,true) | end | ||
end | end | ||
end | end | ||
addCommandHandler(" | addCommandHandler("incrementBlip", makeBlipHigher, false, false) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
Line 34: | Line 33: | ||
==See Also== | ==See Also== | ||
{{Blip functions}} | {{Blip functions}} | ||
[[ | |||
[[hu:setBlipOrdering]] | |||
[[RO:setBlipOrdering]] |
Latest revision as of 20:02, 20 July 2019
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 )
OOP Syntax Help! I don't understand this!
- Method: blip:setOrdering(...)
- Variable: .ordering
- Counterpart: getBlipOrdering
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. Possible range: -32767 to 32767. Default: 0.
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 makeBlipHigher(thePlayer) local setmeup = createBlipAttachedTo ( thePlayer, 3, 3, 255, 0,0,255,0,99999.0, root) 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 end end addCommandHandler("incrementBlip", makeBlipHigher, false, false)