Bean666 Posted January 26, 2017 Share Posted January 26, 2017 (edited) It doesn't trigger the event "satw" when i press the button, NO ERRORS!!! server: marker765 = createMarker (1908.669921875, -498.3203125, 18.026168823242,"cylinder", 1, 255, 0, 0, 100) function showTheGui(player) if getElementType(player) == "player" then triggerClientEvent (player,"showTheGui",getRootElement(),player) end end addEventHandler("onMarkerHit", marker765, showTheGui) addEvent("satw",true) addEventHandler("satw",root, function() if getElementData(source, "satw", true) then outputChatBox("You already own a SAT-W!") cancelEvent() elseif getElementData(source, "satw", false) then if ( getPlayerMoney (source) >= 100000 ) then takePlayerMoney(source, 100000) setElementData(source, "satw", true) outputChatBox("works", source) end end end) function showTime() if getElementData(source, "satw", true) then triggerClientEvent (source,"showTheTime",getRootElement(),source) end end client: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), function() GUIEditor_Window[1] = guiCreateWindow(0.2,0.1602,0.6285,0.5862,"Sattelite Watch",true) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0161,0.1006,0.9678,0.8786,true,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_TabPanel[1],1) GUIEditor_Tab[1] = guiCreateTab("SAT-W",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[1],1) GUIEditor_Button[1] = guiCreateButton(0.025,0.5,0.2493,0.0934,"Buy the SAT-W | $100.000",true,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Button[1],1) guiSetFont(GUIEditor_Button[1],"default-bold-small") GUIEditor_Button[30] = guiCreateButton(0,0,0.2453,0.0854,"Exit",true,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Button[30],1) guiSetVisible (GUIEditor_Window[1],false) end) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == GUIEditor_Button[1]) then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) triggerServerEvent ("satw", getLocalPlayer(),satw) elseif (source == GUIEditor_Button[30]) then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) end end) function showTheGui () guiSetVisible (GUIEditor_Window[1],true) showCursor (true) end addEvent ("showTheGui",true) addEventHandler ("showTheGui",getRootElement(),showTheGui) local hour, minutes = getTime() function draw() dxDrawText(string.format("%02d:%02d", hour, minutes),0, 0) end) local drawingPanel = false; function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = true; showCursor(true) else removeEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = false; showCursor(false) end end addEvent("time", true) addEventHandler("time", getRootElement(), startDrawing_CMD) Edited January 26, 2017 by Shaman123 Link to comment
idarrr Posted January 27, 2017 Share Posted January 27, 2017 addEventHandler("onClientGUIClick",GUIEditor_Button[1], function (button) if (source == GUIEditor_Button[1]) and (button == "left") then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) triggerServerEvent ("satw", getLocalPlayer(),satw) end end) addEventHandler("onClientGUIClick",GUIEditor_Button[30], function (button) if (source == GUIEditor_Button[30]) and (button == "left") then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) end 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