ArtekXDPL Posted July 4, 2015 Share Posted July 4, 2015 Hi all. How to write a script which move the weapon icon in the top right corner of the screen? Weapon icon in the picture: Link to comment
Animan99 Posted July 4, 2015 Share Posted July 4, 2015 hide the original HUD with (https://wiki.multitheftauto.com/wiki/Se ... entVisible) and make your own with dxDraw Link to comment
ArtekXDPL Posted July 4, 2015 Author Share Posted July 4, 2015 Im hide default HUD. Im wanna move weapon icon in top right corner. Link to comment
Animan99 Posted July 4, 2015 Share Posted July 4, 2015 https://wiki.multitheftauto.com/wiki/DxDrawImage Link to comment
ArtekXDPL Posted July 4, 2015 Author Share Posted July 4, 2015 How settings this same position in top right corner screen, at all resolution? Sorry for my english. Link to comment
Animan99 Posted July 4, 2015 Share Posted July 4, 2015 local sWidth, sHeight = guiGetScreenSize() local Width, Height = A, B --write the width and height here local X = sWidth - Width local Y = 0 dxDrawImage(X, Y, Width, Height, etc...) Link to comment
ArtekXDPL Posted July 4, 2015 Author Share Posted July 4, 2015 This is correct? local sWidth, sHeight = guiGetScreenSize() local Width, Height = 1366, 768 --write the width and height here local X = sWidth - Width local Y = 0 function HUD() local weaponType = getPedWeapon(localPlayer) dxDrawImage(300, 300, 128, 128, "Weapons/"..tostring(weaponType).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end function HandleTheRendering() addEventHandler("onClientRender", getRootElement(), HUD) end addEventHandler("onClientResourceStart", resourceRoot, HandleTheRendering) Link to comment
Animan99 Posted July 4, 2015 Share Posted July 4, 2015 almost. 2 mistakes. local Width, Height = 500, 150 -- dont write here your resolution. Write here the width and height of the image you want to draw with dxDrawImage function HUD() local weaponType = getPedWeapon(localPlayer) dxDrawImage(X, Y, Width, Height, "Weapons/"..tostring(weaponType).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) --you have to use the X, Y, Width, Height variables here to work end 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