DarkByte Posted September 22, 2015 Share 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) Link to comment
Moderators Citizen Posted September 22, 2015 Moderators Share 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 ... Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 and i want to change it from corona to image. Link to comment
KariiiM Posted September 22, 2015 Share Posted September 22, 2015 I think he want to do an custom crosshair Link to comment
JR10 Posted September 22, 2015 Share Posted September 22, 2015 Are you talking about the crosshair or the marker itself? Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 Image i added it by photoshop. Corona is is in the script. I wanna make image not corona! Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 corona = createMarker (0, 0, -10, "corona", 1.0, 0, 100, 0, 150) Corona script but i wanna to be image. Link to comment
KariiiM Posted September 22, 2015 Share 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 Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 TO remove CORONA and change to image. Link to comment
KariiiM Posted September 22, 2015 Share 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 Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 To make image move by tank turret and to get end of the target. Link to comment
Moderators Citizen Posted September 22, 2015 Moderators Share 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 ? Link to comment
DarkByte Posted September 22, 2015 Author Share Posted September 22, 2015 http://imgur.com/GazHPek Link to comment
Moderators Citizen Posted September 22, 2015 Moderators Share 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 ? Link to comment
DarkByte Posted September 23, 2015 Author Share Posted September 23, 2015 I will send u in pm. Link to comment
KariiiM Posted September 23, 2015 Share 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 Link to comment
DarkByte Posted September 23, 2015 Author Share Posted September 23, 2015 Not working. Link to comment
KariiiM Posted September 23, 2015 Share 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 Link to comment
DarkByte Posted September 23, 2015 Author Share Posted September 23, 2015 OMG. I already made that not working+ You have some errors in script. Link to comment
KariiiM Posted September 23, 2015 Share Posted September 23, 2015 OMG. I already made that not working+ You have some errors in script. I will test it, hold on Link to comment
KariiiM Posted September 23, 2015 Share 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) Link to comment
DarkByte Posted September 23, 2015 Author Share Posted September 23, 2015 I need to draw crosshair at the end of the turret, not in middle of screen Link to comment
KariiiM Posted September 23, 2015 Share 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) 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