DarkByte Posted September 22, 2015 Posted September 22, 2015 Hi i have a question. How i can change from a corona to a image? Like http://imgur.com/a/1jm8H . From corona to image i edited dat. Code corona = createMarker (0, 0, -10, "corona", 1.0, 0, 100, 0, 150)
Moderators Citizen Posted September 22, 2015 Moderators Posted September 22, 2015 How i can change from a corona to a image? Like http://imgur.com/a/1jm8H In the screenshot, the guy is using a corona ...
DarkByte Posted September 22, 2015 Author Posted September 22, 2015 and i want to change it from corona to image.
KariiiM Posted September 22, 2015 Posted September 22, 2015 I think he want to do an custom crosshair
JR10 Posted September 22, 2015 Posted September 22, 2015 Are you talking about the crosshair or the marker itself?
DarkByte Posted September 22, 2015 Author Posted September 22, 2015 Image i added it by photoshop. Corona is is in the script. I wanna make image not corona!
DarkByte Posted September 22, 2015 Author Posted September 22, 2015 corona = createMarker (0, 0, -10, "corona", 1.0, 0, 100, 0, 150) Corona script but i wanna to be image.
KariiiM Posted September 22, 2015 Posted September 22, 2015 Image i added it by photoshop. Corona is is in the script. I wanna make image not corona! You're not clear
DarkByte Posted September 22, 2015 Author Posted September 22, 2015 TO remove CORONA and change to image.
KariiiM Posted September 22, 2015 Posted September 22, 2015 (edited) TO remove CORONA and change to image. Yes i understand this part, but what's the role of this image? moving or doing what also what's position of it you want it to take the crosshair place or at where Edited September 22, 2015 by Guest
DarkByte Posted September 22, 2015 Author Posted September 22, 2015 To make image move by tank turret and to get end of the target.
Moderators Citizen Posted September 22, 2015 Moderators Posted September 22, 2015 So you want to put a 2D image to replace a 3D object in a 3D world ? Can you show us the image you want to put ?
Moderators Citizen Posted September 22, 2015 Moderators Posted September 22, 2015 So KariiiM was right but no one here could tell for sure that you wanted a crosshair instead of the corona. corona = createMarker (0, 0, -10, "corona", 1.0, 0, 100, 0, 150) Can you show us the entire function so we know where we have to work in ?
KariiiM Posted September 23, 2015 Posted September 23, 2015 (edited) Hey i scripted this part for you, maybe that's what you need as i understood -Client side addEventHandler("onClientVehicleEnter", getRootElement(), function(thePlayer, seat) local tank = {[432]=true} local theVehicle = getPedOccupiedVehicle(localPlayer) if (not theVehicle) then return end local model = getElementModel(theVehicle) if ( thePlayer == localPlayer) then if ( tank[model] ) then addEventHandler("onClientRender", getRootElement(),dxDraw) end end end) function dxDraw() dxDrawImage (sx,sy,sx,sy,"yourImage.png") --draw your image end Edited September 23, 2015 by Guest
KariiiM Posted September 23, 2015 Posted September 23, 2015 (edited) Not working. Edit the image.. you've to draw your own one, click on THIS to see how to draw a image and your picture must be defined in the meta.. and it exist in your resource dxDrawImage (sx,sy,sx,sy,"yourImage.png") --draw your image Edited September 23, 2015 by Guest
DarkByte Posted September 23, 2015 Author Posted September 23, 2015 OMG. I already made that not working+ You have some errors in script.
KariiiM Posted September 23, 2015 Posted September 23, 2015 OMG. I already made that not working+ You have some errors in script. I will test it, hold on
KariiiM Posted September 23, 2015 Posted September 23, 2015 Its working now, i changed something and i fixed some warnings local sx, sy = guiGetScreenSize() function createImage() dxDrawImage((sx-68)/ 2, (sy-54)/2, 68, 54, "yourCrossHair.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientVehicleEnter", getRootElement(), function () local player = getLocalPlayer() local theVehicle = getPedOccupiedVehicle( player ) if ( getElementType ( theVehicle ) == 'vehicle' and isPedInVehicle ( player ) and getElementModel ( theVehicle ) == 432 ) then if (theVehicle) then addEventHandler ( "onClientRender", root, createImage ) end end end)
DarkByte Posted September 23, 2015 Author Posted September 23, 2015 I need to draw crosshair at the end of the turret, not in middle of screen
KariiiM Posted September 23, 2015 Posted September 23, 2015 I need to draw crosshair at the end of the turret, not in middle of screen Do it by yourself? and get your own Resolution, Here's full code i cleaned and added something local sx, sy = guiGetScreenSize() function createImage() dxDrawImage((sx - 68) / 2, (sy - 54) / 2, 68, 54, "yourcrosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientVehicleEnter", getRootElement(), function (player, seat) local theVehicle = getPedOccupiedVehicle( player ) if ( player == getLocalPlayer() and getElementType ( theVehicle ) == 'vehicle' and isPedInVehicle ( player ) and getElementModel ( theVehicle ) == 432 ) then if (theVehicle) then addEventHandler ( "onClientRender", root, createImage ) end end end) function destroyImage(player, seat) if ( player == getLocalPlayer() and getElementType ( theVehicle ) == 'vehicle' and not isPedInVehicle ( player ) and getElementModel ( theVehicle ) == 432 ) then removeEventHandler ( "onClientRender", root, createImage ) end end addEventHandler("onClientVehicleExit", getRootElement(),destroyImage)
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