Turbe$Z Posted May 3, 2017 Share Posted May 3, 2017 i tried this, but the blips are doesn't show addEventHandler( "onClientResourceStart", resourceRoot, function() showPlayerHudComponent("radar", false) hudMaskShader = dxCreateShader("hud_mask.fx") radarTexture = dxCreateTexture("images/radar.jpg") maskTexture1 = dxCreateTexture("images/circle_mask.png") localplayerblip = dxCreateTexture("images/arrow.png") -- this is the localplayer blip otherplayerblip = dxCreateTexture("images/target.png") -- this is the otherplayer blip bAllValid = hudMaskShader and radarTexture and maskTexture1 and localplayerblip and otherplayerblip if not bAllValid then outputChatBox( "Could not create some things. Please use debugscript 3" ) else dxSetShaderValue( hudMaskShader, "sPicTexture", radarTexture ) dxSetShaderValue( hudMaskShader, "sMaskTexture", maskTexture1 ) dxSetShaderValue( hudMaskShader, "lPlayerTexture", localplayerblip ) end end ) addEventHandler( "onClientRender", root, function() if not bAllValid then return end local x,y = getElementPosition(localPlayer) x = ( x ) / 6000 y = ( y ) / -6000 dxSetShaderValue( hudMaskShader, "gUVPosition", x,y ) local _,_,camrot = getElementRotation( getCamera() ) dxSetShaderValue( hudMaskShader, "gUVRotAngle", math.rad(-camrot) ) dxDrawImage( 30, 650, 300, 250, hudMaskShader, 0,0,0, tocolor(255,255,255,230) ) end ) how to create blips? sorry for my bad english Link to comment
Function Posted May 3, 2017 Share Posted May 3, 2017 (edited) I don't know but i think... local r,g,b = math.random(255),math.random(255),math.random(255) for _,player in ipairs(getElementsByType("player")) do createBlipAttachedTo(player,0,2,r,g,b) Edited May 3, 2017 by Function Link to comment
Turbe$Z Posted May 3, 2017 Author Share Posted May 3, 2017 6 minutes ago, Function said: I don't know but i think... function blips() local r,g,b = math.random(255),math.random(255),math.random(255) for _,player in ipairs(getElementsByType("player")) do createBlipAttachedTo(player,0,2,r,g,b) end end doesn't working Link to comment
3aGl3 Posted May 3, 2017 Share Posted May 3, 2017 (edited) If you created the script yourself you will have to write script that takes care of the blips (and radar areas too I guess). You will have to do something like this: local blips = getElementsByType( "blip" ) for i, blip in ipairs(blips) do local x, y, _ = getElementPosition( blip ) local v = 0 dxDrawImageSection( x, y, 10, 10, 0, v, 16, 16, blipTexture ) end This is assuming that you have a sprite with all blips, which seems like a good idea to me. Also you will need to calculate the V position based on the ID the blip is, if the blip has a color you might want to take that into account etc. Oh and of course you will need a render target so the radar map can be updated by dx drawing on it. Edited May 3, 2017 by 3aGl3 Link to comment
Turbe$Z Posted May 4, 2017 Author Share Posted May 4, 2017 20 hours ago, 3aGl3 said: If you created the script yourself you will have to write script that takes care of the blips (and radar areas too I guess). You will have to do something like this: local blips = getElementsByType( "blip" ) for i, blip in ipairs(blips) do local x, y, _ = getElementPosition( blip ) local v = 0 dxDrawImageSection( x, y, 10, 10, 0, v, 16, 16, blipTexture ) end This is assuming that you have a sprite with all blips, which seems like a good idea to me. Also you will need to calculate the V position based on the ID the blip is, if the blip has a color you might want to take that into account etc. Oh and of course you will need a render target so the radar map can be updated by dx drawing on it. ahh, i don't understand this how? 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