Hello, I have a similar functions which activated when the client clicked on the button. Now Im calling they like different functions.
addEventHandler("onClientGUIClick", ctrl[1], setCtrl1, false)
addEventHandler("onClientGUIClick", ctrl[2], setCtrl2, false)
addEventHandler("onClientGUIClick", ctrl[3], setCtrl3, false)
I want to call one function when I push the different buttons
addEventHandler("onClientGUIClick", ctrl[1], setCtrl, false)
addEventHandler("onClientGUIClick", ctrl[2], setCtrl, false)
addEventHandler("onClientGUIClick", ctrl[3], setCtrl, false)
But also I want to do this with a different actions in function. Unfortunely, I did not found the way how can I check the button which clicked.
Im planing to do something like this:
-- This just an example
function()
if ctrl[1] then
--do something
elseif ctrl[2] then
--do anything
elseif ctrl[3] then
--do this but it actually looks like previous
end
end
addEventHandler("onClientGUIClick", ctrl[1], setCtrl, false)
addEventHandler("onClientGUIClick", ctrl[2], setCtrl, false)
addEventHandler("onClientGUIClick", ctrl[3], setCtrl, false)