Jump to content

Problem with trigger.


Rat32

Recommended Posts

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...