Hi Community,
I created a panel for players to enter missions.There are names of the missions in the gridlists. But I do not want two players to enter the same mission.To prevent this, I gave data to the button to select the mission, and even if a second player clicks on that button, second player cannot enter the mission.
The mission is on the server side and I want to give false data to the gui button when the mission is completed. How can I do this? How can I give false data to the gui button from the server side? can you help me ?
function GoMission()
if ( source == spawnButton ) then
if getElementData(spawnButton,"paparazziFull") then return end --Other player cannot enter the mission
local name = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 )
if name == "Kill The Paparazzi" then
setElementData(spawnButton,"paparazziFull",true) ----- There is someone in mission
triggerServerEvent("PaparazziStart",localPlayer,localPlayer)
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
playSoundFrontEnd ( 6)
elseif name == "Andre Must Die" then
triggerServerEvent("andreStart",localPlayer,localPlayer)
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
playSoundFrontEnd ( 6)
elseif name == "Cleaning The Hood" then
triggerServerEvent("DrugDealerStart",localPlayer,localPlayer)
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
playSoundFrontEnd ( 6)
elseif name == "Rifas Die In Vinewood" then
triggerServerEvent("rifaStart",localPlayer,localPlayer)
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
playSoundFrontEnd ( 6)
end
end
end
addEventHandler("onClientGUIClick",spawnButton,GoMission)