gerlachmax123 Posted February 22, 2013 Share Posted February 22, 2013 How i can create a Blip on any vehicle if the vehicle is burning = (249) Link to comment
gokalpfirat Posted February 22, 2013 Share Posted February 22, 2013 function check() if (getElementHealth(source) < 250) then local x,y,z = getElementPosition(source) createBlip(x,y,z,0) end end addEventHandler("onVehicleDamage", getRootElement(), check) Link to comment
gerlachmax123 Posted February 22, 2013 Author Share Posted February 22, 2013 No check every 1 second or so? Link to comment
gokalpfirat Posted February 22, 2013 Share Posted February 22, 2013 Nope it checks when a vehicle dameges. But i dont make it harder like if vehicle disappers blip disappears too i dont do this only when a vehicle get damage and has <250 health then it make a blip to there. Link to comment
gerlachmax123 Posted February 22, 2013 Author Share Posted February 22, 2013 Why this want work? barricadeFactions = { [10]=true } vehicleBlips = {} addEventHandler( "onClientElementStreamIn", getRootElement(), function() if getElementType( source ) == "vehicle" then if getElementHealth ( source ) < 250 then if barricadeFactions[getElementData ( lp, "fraktion" )] then setTimer( function( v ) vehicleBlips[v] = createBlipAttachedTo( v, 27, 1 ) end, 100, 1, source ) end end end end ) addEventHandler( "onClientElementStreamOut", getRootElement(), function() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end ) Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 function check() if (getElementHealth(source) < 250) then local x,y,z = getElementPosition(source) createBlip(x,y,z,0) end end addEventHandler("onVehicleDamage", getRootElement(), check) This will create a blip in the position of the car damage, But blip is not attached !! Try this .. addEvent("burnBlip", true) addEventHandler("burnBlip", root, function (car) if getElementType(car) == "vehicle" then local check = getElementHealth(car) if check < 250 then local x,y,z = getElementPosition(source) local blip = createBlip(x,y,z, 43) attachElements(blip, car) else destroyElement(blip) end end end ) Link to comment
gerlachmax123 Posted February 22, 2013 Author Share Posted February 22, 2013 This wont check the vehicle, if the vehicle will be repaired.. addEvent("burnBlip", true) addEventHandler("burnBlip", root, function (car) if getElementType(car) == "vehicle" then local check = getElementHealth(car) if check < 250 then local x,y,z = getElementPosition(source) local blip = createBlip(x,y,z, 43) attachElements(blip, car) else destroyElement(blip) end end end ) Link to comment
Castillo Posted February 22, 2013 Share Posted February 22, 2013 Why this want work? barricadeFactions = { [10]=true } vehicleBlips = {} addEventHandler( "onClientElementStreamIn", getRootElement(), function() if getElementType( source ) == "vehicle" then if getElementHealth ( source ) < 250 then if barricadeFactions[getElementData ( lp, "fraktion" )] then setTimer( function( v ) vehicleBlips[v] = createBlipAttachedTo( v, 27, 1 ) end, 100, 1, source ) end end end end ) addEventHandler( "onClientElementStreamOut", getRootElement(), function() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end ) Errors on debugscript? did you set it client side on meta.xml? Link to comment
gerlachmax123 Posted February 23, 2013 Author Share Posted February 23, 2013 oh it works, but when the car is burning, you must go away and the come again. Then is the Blip there This works serverside too? Link to comment
gerlachmax123 Posted February 23, 2013 Author Share Posted February 23, 2013 when the car is burning, you must go away and the come again to see the blip... Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now