Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ THIS IS IN ITS OWN SCRIPT FILE ]]
- function Super_Update_Money(player, amount)
- print("Inside the SuperTable Super_Update_Money method")
- local steamid = Super_Get_Steam_ID(player)
- local tempamount = amount
- local sql = "UPDATE supertable SET money = money + @money WHERE steamid = @id"
- local param = {id = steamid, money = tempamount}
- MySQL.Async.execute(sql, param)
- end
- --[[ THIS METHOD IS EXPOSED VIA SERVER_EXPORT
- server_export 'Super_Update_Money'
- --[[ THIS IS IN A SEPERATE WRAPPER FILE INCLUDED IN THE SSAME RESOURCE (BOTH FILES ARE SERVER_SCRIPT 'name_here.lua') ]]
- function UpdateMoney(player, amount)
- exports['supertable']:Super_Update_Money(player,amount)
- end
- --[[ THIS IS IN THE SAME FILE AS THE WRAPPER JUST ABOVE THIS... ]]
- RegisterServerEvent('UpdateMoney', function(amount)
- print("Inside The Update Money Server Event")
- UpdateMoney(source, amount)
- end)
- --[[ EVERYTHING ELSE HERE WORKS, EXCEPT THE TRIGGER SERVER EVENT ]]
- for k,v in pairs(objval) do
- if DoesEntityExist(k) then
- if IsEntityTouchingEntity(PlayerPedId(), k) then
- print(k .. " : " .. v.worth)
- TriggerServerEvent('UpdateMoney', v.worth) -- <----- This wont Trigger.
- DeleteObject(k)
- objval[k] = nil
- Wait(50)
- end
- end
- end
- --[[ I TRIED DEBUGGING BUT NOTHING SEEMS OBVIOUS. ANY SOLUTIONS? ]]
Advertisement
Add Comment
Please, Sign In to add comment