HU/getBlipVisibleDistance: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
 (→Példa)  | 
				|||
| Line 13: | Line 13: | ||
==Példa==    | ==Példa==    | ||
Ez a példa bemutatja a [[getBlipVisibleDistance]] alapvető funkcióit  | |||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
local blip = createBlip(0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1000)  | local blip = createBlip(0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1000)  | ||
Revision as of 21:15, 23 July 2018
Ez a funkció megmondja, hogy milyen látható távolsága van a blipnek.
Szintaxis
float getBlipVisibleDistance ( blip theBlip )
OOP Syntax Help! I don't understand this!
- Method: blip:getVisibleDistance(...)
 - Variable: .visibleDistance
 - Counterpart: setBlipVisibleDistance
 
Kötelező argumentumok
- theBlip: a blip, melyeknek a látható távolságát szeretné megkapni.
 
Visszaadott érték
Visszaad egy float értéket a blip látható távolságával, false ha a blip érvénytelen.
Példa
Ez a példa bemutatja a getBlipVisibleDistance alapvető funkcióit
local blip = createBlip(0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1000)
outputDebugString("Blip visible distance: "..getBlipVisibleDistance(blip))
This example will combine the total visible distances of all blips
-- Retrieve a table containing all the blips that exist
local blips = getElementsByType("blip")
local distance = 0
-- Loop through the list, storing the blips visible distance with the rest.
for index, blip in ipairs(blips) do
	-- Retrieve the blip's visible distance
	distance = distance + getBlipVisibleDistance(blip) or 0 -- "or 0" just incase its false ;)
end
outputDebugString("Combined total of all blips visible distances: "..distance)