Hey Guys,
I've started to make my userpanel but i just got a problem with the triggering .
I just want to trigger the selected item from my gridlist(it's a dx gridlist)
It outputs me "Triggered" but it just doesn't do the code after the outputChatBox, i dunno why.
Could you help me out please?
Here's my server-side file :
addEvent("Fun_Shop",true)
function Fun_Shop_s(resgrid)
outputChatBox("Triggered")
local username = getElementData ( source, "username" )
local query = dbQuery(connect, "SELECT * FROM wcf1_user WHERE username = '"..username.."'")
local result = dbPoll(query, -1)
local datas = result[1]
local rainbow = datas["rainbow"]
local money = datas["money"]
if rainbow == 1 then
outputChatBox("Du besitzt dieses Item bereits!",source, 125,0,0,false)
elseif rainbow == nil then
if money > 200000 then
money = datas.money - 200000
dbExec(connect,"UPDATE wcf1_user SET rainbow=?,money=? WHERE username=?",1,money,name)
setElementData(source,"rainbow",1)
else
outputChatBox("Du hast nicht genügend Geld!(200,000$)",source,125,0,0,false)
end
end
end
addEventHandler("Fun_Shop",root,Fun_Shop_s)
And the client-side part:
addEventHandler("onClientGUIClick", f_g_btn,
function()
if resgrid == nil then
outputChatBox("Bitte wähle etwas aus!")
elseif resgrid then
triggerServerEvent( "Fun_Shop" ,localPlayer, tostring( resgrid ) )
end
end)
btw , no debug errors.