xXMADEXx Posted January 24, 2013 Share Posted January 24, 2013 For some reason the gate dosn't open server.lua objct1 = createObject ( 980, -55, -95, 1013,0,0,90) setElementInterior(objct1,18) function gateOpen() moveObject (objct1, 500, -55, -95, 1005) playSoundFrontEnd(source, 1) triggerEvent(source,"message:addMessage",source,"Jail: Moving Main Gate.",255, 255, 0) end addEvent("jail.gate.open",true) addEventHandler("jail.gate.open",gateOpen) client.lua --Gate mrkr = createMarker( -54.1416015625, -91.8134765625, 1010.182800293, "cylinder", 8, 0, 255, 0, 80) setElementInterior(mrkr,18) window = guiCreateWindow(471,334,337,268,"Jail",false) guiSetAlpha(window,1) guiSetVisible(window,false) guiWindowSetMovable(window,false) guiWindowSetSizable(window,false) lbl = guiCreateLabel(9,28,316,109,"Open\nGate?",false,window) guiLabelSetColor(lbl,255,0,0) guiLabelSetHorizontalAlign(lbl,"center",false) guiSetFont(lbl,"sa-header") btn_accpt = guiCreateButton(9,198,157,61,"Yes",false,window) btn_close = guiCreateButton(167,198,157,61,"No",false,window) function onhit() guiSetVisible(window,true) showCursor(true) end addEventHandler("onClientMarkerHit",mrkr,onhit) function close() guiSetVisible(window,false) showCursor(false,false) end addEventHandler("onClientGUIClick",btn_close,close) function accept() triggerServerEvent("jail.gate.open") outputChatBox("Jail: Main gate opening...",255,255,0) guiSetVisible(window,false) showCursor(false,false) end addEventHandler("onClientGUIClick",btn_accpt,accept) Link to comment
Castillo Posted January 24, 2013 Share Posted January 24, 2013 Change: triggerServerEvent("jail.gate.open") To: triggerServerEvent("jail.gate.open", localPlayer) Link to comment
xXMADEXx Posted January 24, 2013 Author Share Posted January 24, 2013 Change: triggerServerEvent("jail.gate.open") To: triggerServerEvent("jail.gate.open", localPlayer) Didn't work Link to comment
iPrestege Posted January 24, 2013 Share Posted January 24, 2013 --Gate mrkr = createMarker( -54.1416015625, -91.8134765625, 1010.182800293, "cylinder", 8, 0, 255, 0, 80) setElementInterior(mrkr,18) window = guiCreateWindow(471,334,337,268,"Jail",false) guiSetAlpha(window,1) guiSetVisible(window,false) guiWindowSetMovable(window,false) guiWindowSetSizable(window,false) lbl = guiCreateLabel(9,28,316,109,"Open\nGate?",false,window) guiLabelSetColor(lbl,255,0,0) guiLabelSetHorizontalAlign(lbl,"center",false) guiSetFont(lbl,"sa-header") btn_accpt = guiCreateButton(9,198,157,61,"Yes",false,window) btn_close = guiCreateButton(167,198,157,61,"No",false,window) function onhit() guiSetVisible(window,true) showCursor(true) end addEventHandler("onClientMarkerHit",mrkr,onhit) function close() guiSetVisible(window,false) showCursor(false,false) end addEventHandler("onClientGUIClick",btn_close,close) function accept() triggerServerEvent("jail.gate.open",localPlayer,localPlayer) outputChatBox("Jail: Main gate opening...",255,255,0) guiSetVisible(window,false) showCursor(false,false) end addEventHandler("onClientGUIClick",btn_accpt,accept) Link to comment
Vision Posted January 24, 2013 Share Posted January 24, 2013 Change this addEventHandler("jail.gate.open",gateOpen) to this addEventHandler("jail.gate.open", root, gateOpen) 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