i cant seem to get the ui to appear when i click the rock any idea why
server:
function createMiningRock()
miningRock = createObject(17026, 2343, -651, 125,0,0,0)
end
addEventHandler("onResourceStart",getRootElement(),createMiningRock)
function rockClicked( theButton, theState, thePlayer )
if theButton == "right" and theState == "down" then
outputChatBox( "You should have a window now", thePlayer )
triggerClientEvent("showMiningUI", getRootElement())
end
end
addEventHandler( "onElementClicked", getRootElement(), rockClicked )
[/code]
client:
function showMiningUI()
miningUI = guiCreateWindow(773, 426, 399, 205, "Mining", false)
guiWindowSetSizable(miningUI, false)
guiSetAlpha(miningUI, 1.00)
guiSetProperty(miningUI, "CaptionColour", "FF2FFF00")
bStartMining = guiCreateButton(11, 121, 376, 66, "Start Mining", false, miningUI)
bCancelMining = guiCreateButton(359, 26, 18, 15, "x", false, miningUI)
guiSetProperty(bStartMining, "NormalTextColour", "FF2FFF00")
guiSetProperty(bMiningCancel, "NormalTextColour", "FFFD0102")
helpText = guiCreateLabel(10, 31, 362, 112, "To start mining just click the button below and wait until your \ncharacter stops gathering to do it again. To abort current task \njust click on the \"x\" at the top right of the UI", false, miningUI)
addEventHandler("onClientGUIClick", bStartmining, startMining)
addEventHandler("onClientGUIClick", bcancelMining, cancelMining)
end