Rat32 Posted May 8, 2015 Share Posted May 8, 2015 Hello! clientside: function wyladunki() if source == punkt then kasa = guiGetText(wynagrodzenie) exports["notifications"]:showBox("info", "Dostarczyłeś ładunek. Twoje wynagrodzenie to: "..kasa) triggerServerEvent("hajsy", getRootElement(), kasa) destroyElement(punkt) destroyElement(blip) trasa = false end end addEventHandler("onClientMarkerHit", getRootElement(), wyladunki) serverside: function manimani(kasa) givePlayerMoney(source, kasa) end addEvent("hajsy", true) addEventHandler("hajsy", getRootElement(), manimani) In debugscript nothing. Script not work, why? (this is only part of this script) Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 function wyladunki(player) if player == localPlayer then if source == punkt then local kasa = guiGetText(wynagrodzenie) exports["notifications"]:showBox("info", "Dostarczyłeś ładunek. Twoje wynagrodzenie to: "..kasa) triggerServerEvent("hajsy", localPlayer, kasa) destroyElement(punkt) destroyElement(blip) punkt = nil blip = nil trasa = false end end end addEventHandler("onClientMarkerHit", root, wyladunki) function manimani(kasa) givePlayerMoney(client, tonumber(kasa)) end addEvent("hajsy", true) addEventHandler("hajsy", root, manimani) Link to comment
rtx Posted May 8, 2015 Share Posted May 8, 2015 Notice that the event's element is the root element, NOT the player who hit the marker. -- Client: triggerServerEvent("hajsy", localPlayer, kasa) Link to comment
Rat32 Posted May 8, 2015 Author Share Posted May 8, 2015 Not work. First and second ;d Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 Then it's not a trigger issue anymore. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now