stevensalvaro Posted January 23, 2016 Share Posted January 23, 2016 Hello, How can i add dxdrawrectangle on this script , it's doesn't appears ,, so i want when i enter the vehicle the rectangle appears Client THIS_RESOURCE = getThisResource(); ROOT_ELEMENT = getRootElement(); GUI = { button1 = false }; OnResourceStart = function(resource) if resource == THIS_RESOURCE then GUI.button1 = guiCreateStaticImage( 20, 200, 64, 64, "hud.png", false ) guiSetVisible(GUI.button1, false); end return; end OnResourceStop = function(resource) if resource == THIS_RESOURCE then if GUI.button1 ~= false then destroyElement(GUI.button1); end end return; end OnVehicleEnter = function(player, seat, jacked) -- source = vehicle_element if GUI.button1 ~= false then guiSetVisible(GUI.button1, true); end return; end OnVehicleExit = function(player, seat, jacked) -- source = vehicle_element if GUI.button ~= false then guiSetVisible(GUI.button1, false); end return; end OnGUIClick = function(button1, state, x, y) -- source = gui if state then if source == GUI.button1 and guiGetVisible(GUI.button1) == true then triggerServerEvent("toggleEngine", localPlayer, localPlayer) end end return; end addEventHandler("onClientResourceStart", ROOT_ELEMENT, OnResourceStart ); addEventHandler("onClientResourceStop", ROOT_ELEMENT, OnResourceStop ); addEventHandler("onClientVehicleEnter", ROOT_ELEMENT, OnVehicleEnter ); addEventHandler("onClientVehicleExit", ROOT_ELEMENT, OnVehicleExit ); addEventHandler("onClientGUIClick", ROOT_ELEMENT, OnGUIClick ); Link to comment
KariiiM Posted January 23, 2016 Share Posted January 23, 2016 Where's the DirectxDrawRectangle part ? Link to comment
stevensalvaro Posted January 23, 2016 Author Share Posted January 23, 2016 i cant add dxdrawrectangle on this script , if i put it on this script , it's not appears .. Link to comment
KariiiM Posted January 23, 2016 Share Posted January 23, 2016 i cant add dxdrawrectangle on this script , if i put it on this script , it's not appears .. But how could we help you if you didn't post the dxDrawRectangle to fix the bug to become able to appears, I think is it your main problem? Link to comment
stevensalvaro Posted January 24, 2016 Author Share Posted January 24, 2016 i know how to make dxdrawrectangle , but in this case , i can't add dx on gui function , may i make new function on it ? 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