Jump to content

blips


MOGA672002

Recommended Posts

which line or which word is meaning the size ?
 

function createMarkers()
	local file = xmlLoadFile("locations.xml")
	for index, value in pairs(xmlNodeGetChildren(file)) do
		local m = split(xmlNodeGetAttribute(value, "pos"), string.byte(","))
		marker = createMarker(m[1], m[2], m[3], "cylinder", 4, 181, 2, 32, 180)
		blip = createBlipAttachedTo(marker, 63)
		setBlipVisibleDistance(blip, 300)
		addEventHandler("onMarkerHit", marker, enteredPaySpray)
	end
end
addEventHandler("onResourceStart", resourceRoot, createMarkers)

function enteredPaySpray(element)
	if (element and isElement(element) and getElementType(element) == "vehicle") then
		local plr = getVehicleController(element)
		if (isElement(plr)) then
			if (getElementHealth(element) >= 999) then
				exports.CRGtexts:output("Your vehicle does already have max health", plr, 255, 0, 0)
				return
			end
			local price = math.floor((1000 - getElementHealth(element)) / 2.3)
			if (getPlayerMoney(plr) <= price) then
				local missing = math.floor(price - getPlayerMoney(plr))
				exports.CRGtexts:output("You are missing $"..missing.." for a repair", plr, 255, 0, 0)
				return
			end
			setElementHealth(element, 1000)
			fixVehicle(element, 1000)
			setElementFrozen(element, true)
			takePlayerMoney(plr, price)
			fadeCamera(plr, false)
			setTimer(finishRepair, 2000, 1, plr, element, price)
		end
	end		
end

function finishRepair(plr, veh, cash)
	if (isElement(plr) and isElement(veh)) then
		fadeCamera(plr, true)
		setElementFrozen(veh, false)
		exports.CRGtexts:output("You have succesfully repaired your vehicle for $"..cash, plr, 0, 255, 0)
		exports.CRGtrivia:sendMessage( "Your vehicle was fixed!", plr, 0, 255, 0 )
	end
end

 

Link to comment
28 minutes ago, MOGA672002 said:

which line or which word is meaning the size ?
 


function createMarkers()
	local file = xmlLoadFile("locations.xml")
	for index, value in pairs(xmlNodeGetChildren(file)) do
		local m = split(xmlNodeGetAttribute(value, "pos"), string.byte(","))
		marker = createMarker(m[1], m[2], m[3], "cylinder", 4, 181, 2, 32, 180)
		blip = createBlipAttachedTo(marker, 63)
		setBlipVisibleDistance(blip, 300)
		addEventHandler("onMarkerHit", marker, enteredPaySpray)
	end
end
addEventHandler("onResourceStart", resourceRoot, createMarkers)

function enteredPaySpray(element)
	if (element and isElement(element) and getElementType(element) == "vehicle") then
		local plr = getVehicleController(element)
		if (isElement(plr)) then
			if (getElementHealth(element) >= 999) then
				exports.CRGtexts:output("Your vehicle does already have max health", plr, 255, 0, 0)
				return
			end
			local price = math.floor((1000 - getElementHealth(element)) / 2.3)
			if (getPlayerMoney(plr) <= price) then
				local missing = math.floor(price - getPlayerMoney(plr))
				exports.CRGtexts:output("You are missing $"..missing.." for a repair", plr, 255, 0, 0)
				return
			end
			setElementHealth(element, 1000)
			fixVehicle(element, 1000)
			setElementFrozen(element, true)
			takePlayerMoney(plr, price)
			fadeCamera(plr, false)
			setTimer(finishRepair, 2000, 1, plr, element, price)
		end
	end		
end

function finishRepair(plr, veh, cash)
	if (isElement(plr) and isElement(veh)) then
		fadeCamera(plr, true)
		setElementFrozen(veh, false)
		exports.CRGtexts:output("You have succesfully repaired your vehicle for $"..cash, plr, 0, 255, 0)
		exports.CRGtrivia:sendMessage( "Your vehicle was fixed!", plr, 0, 255, 0 )
	end
end

 

blip = createBlipAttachedTo(marker, 63)  ---------------here Put the size like >>>>>  blip = createBlipAttachedTo(marker,[ 63,2])------ 2 = size

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...