VenomOG Posted August 12, 2018 Share Posted August 12, 2018 PROBLEM 1- When click accept in client side it dosn't trigger server event 2-I want only specific teams can revive 3-Click Deny not work. CODES: SERVER----- ped = createPed(217,-2407.10815, -597.88330, 132.64844,80) function click( btn, stat, plr) if btn ~= "left" and stat ~= "down" then return end if getElementType( source) ~= "ped" then return end triggerClientEvent("showRevive", getRootElement()) end addEventHandler( "onElementClicked", getRootElement(), click ) addEvent("revieve" ,true) addEventHandler("revieve", root, function () local x, y, z = getElementPosition(source) local Team = getPlayerTeam(source) outputChatBox("Hi") spawnPlayer(source, x, y, z) spawnPlayer(source, x, y, z, 0, 0, 0, 0, Team) setElementHealth(source, 100) setPedAnimation(source, false) setElementData(source, "rev", false) end) CLIENT GUIEditor = { button = {}, window = {}, progressbar = {}, label = {} } addEvent("showRevive", true) addEventHandler("showRevive", root, function(player) if panelOpen then return end panelOpen = true local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow(321, 277, 408, 178, "Revive", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(252, 148, 15, 15, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(6, 24, 392, 66, "PLAYER IS TRYING TO REVIVE YOU CLICK ACCEPT TO ACCEPT AND BE ALIVE\nOR CLICK DENY TO DIE AND SUFFER", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(GUIEditor.label[2], "left", true) BUTTON1 = guiCreateButton(9, 128, 153, 35, "Accept", false, GUIEditor.window[1]) BUTTON2 = guiCreateButton(235, 128, 153, 35, "Deny", false, GUIEditor.window[1]) GUIEditor.progressbar = guiCreateProgressBar(284, 481, 479, 52, false) end ) addEventHandler("onClientGUIClick", BUTTON1, function () if getElementType(source) == "gui-button" then triggerServerEvent("revieve",root) destroyElement(GUIEditor.window[1],true) showCursor(false) end end) addEventHandler("onClientGUIClick", BUTTON2, function() if getElementType(source) == "gui-button" then destroyElement(GUIEditor.window[1]) 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