Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-12-24, 21:23


DaVeCS

Mapper






Wiek: 31
Na forum: 3386 dni
Posty: 193
Nick w MP: DaVe

Piwa: 59

Respekt: 70,5

Witam ot?? mam taki b??d w pracy i nie dostaje kasy:

[2017-12-24 21:21] ERROR: Client (#4060e0#dbb234.DaVe) triggered serverside event prace:wyplata, but event is not added serverside

Mo?e kto? pom?c?

Strona Client:
zwierzeta={
{-1881.40, -2174.7985.06},
{-1887.23, -1983.7086.13},
{-1676.47, -1980.9396.34},
{-1471.90, -2195.237.73},
{-1640.10, -2315.1759.96},
{-1820.44, -2287.7953.45},
{-1801.84, -2241.3569.46},
{-1629.12, -2091.9843.23},
{-1557.56, -2219.597.87},
{-1638.03, -2278.5537.13},
{-1666.97, -2173.9934.96},
{-1729.80, -2097.6940.80},
{-1939.95, -2116.1571.85},
{-1751.03, -2346.2251.86},
{-1624.75, -2231.4828.99},
{-1622.16, -2367.7845.27},
}
typyzwierzat={ -- kasazasi?g widzeniaskin
{20000,18,121},
{35000,24,122},
{50000,30,123},
}
ilosctypow=#typyzwierzat
aktualneZwierzeta={}
sfery={}
zajete={}
tablesize=function(tabela)
    l=0
    for i,v in pairs(tabela) do
    l=l+1
    end
    return l
end
ilosczwierzat=tablesize(zwierzeta)
function stworzZwierzeta(usun,ilosc,id)
    if not id then id=-1 end
    if usun then
        for i,v in pairs(aktualneZwierzeta) do
            destroyElement(aktualneZwierzeta[i])
            destroyElement(sfery[i])
        end
        aktualneZwierzeta={}
        sfery={}
        zajete={}
        return
    end
    for i=1,ilosc do
        liczba=math.random(ilosczwierzat)
        e=0
        while zajete[liczba] or aktualneZwierzeta[liczba] or liczba==id do
            liczba=math.random(ilosczwierzat)
            e=e+1
            if e>15 then return outputChatBox("e>15"end
        end
        typ=typyzwierzat[math.random(ilosctypow)]
        pos=zwierzeta[liczba]
        aktualneZwierzeta[liczba]=createPed(typ[3],pos[1],pos[2],pos[3])
        sfery[liczba]=createColSphere(pos[1],pos[2],pos[3],typ[2])
        attachElements(sfery[liczba],aktualneZwierzeta[liczba])
        setElementData(aktualneZwierzeta[liczba],"parent",sfery[liczba])
        setElementData(sfery[liczba],"zwierze",true)
        setElementData(sfery[liczba],"id",liczba)
        setElementData(sfery[liczba],"parent",aktualneZwierzeta[liczba])
        setElementData(sfery[liczba],"kasa",typ[1])
        zajete[liczba]=true
    end
end

addEvent("MysliwyStart"true)
addEventHandler("MysliwyStart"resourceRoot, function()
    stworzZwierzeta(false,3)
    if isTimer(timerthen
        killTimer(timer)
    end
    timer=setTimer(zwierzetaMove,2000,0)
end)
addEvent("MysliwyStop"true)
addEventHandler("MysliwyStop"resourceRoot, function()
    stworzZwierzeta(true)
    if isTimer(timerthen
        killTimer(timer)
    end
end)

function MarkerHit(hitElement)
    if hitElement==localPlayer then
        if getElementData(source,"zwierze"then
            id=getElementData(source,"id")
            destroyElement(getElementData(source,"parent"))
            destroyElement(source)
            stworzZwierzeta(false,1,id)
            aktualneZwierzeta[id]=nil
            sfery[id]=nil
            zajete[id]=nil
            outputChatBox("Sp?oszy?e? zwierz?! Pami?taj ?e nie mo?esz za blisko zwierz?t podchodzi?!",255,0,0)
        end
    end
end
addEventHandler("onClientColShapeHit",resourceRoot,MarkerHit)

function zwierzetaMove()
    for i,v in pairs(aktualneZwierzeta) do
        setPedControlState(v,"walk",true)
        setPedControlState(v,"forwards",true)
        setElementRotation(v,0,0,math.random(0,360))
    end
end

function pedDmg(attacker)
    if attacker==localPlayer then
        source=getElementData(source,"parent")
        if source and getElementData(source,"zwierze"then
            wyplata=getElementData(source,"kasa")
            outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
            triggerServerEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
            id=getElementData(source,"id")
            destroyElement(getElementData(source,"parent"))
            destroyElement(source)
            stworzZwierzeta(false,1,id)
            aktualneZwierzeta[id]=nil
            sfery[id]=nil
            zajete[id]=nil
        end
    end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)

addEventHandler("onClientPlayerDamage"localPlayer, function(attackerweaponbodypart)
    if bodypart == or bodypart == or bodypart == or bodypart == or bodypart == or bodypart == or bodypart == 9 then
        if weapon == 33 then
            cancelEvent()
        end
    end
end)

addEventHandler("onClientVehicleDamage"root, function(attacherweapon)
    if weapon == 33 then
        cancelEvent()
    end
end)



Strona Server:

function start()
    mysliwystart=createMarker(-1632.57, -2245.4931.48-1,"cylinder",1.5,0,255,0,170)
    code="Mysliwy"
    miejsce=createColSphere(-1632.57, -2245.4931.48,600)
end
createBlip(-1632.57, -2245.4931.48,46)    
start()


function MarkerHit(el,md)
    if source==mysliwystart then
        if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
        job=getElementData(el,"player:job")
        if job then
            if job==code then
                data=getElementData(el,"MysliwyStrzelanie")
                if data then
                    takeWeapon(el,33,1000)
                    toggleControl(el,"fire",data.fire)
                    toggleControl(el,"aim_weapon",data.aim)
                    toggleControl(el,"next_weapon",data.nexweapon)
                    toggleControl(el,"previous_weapon",data.prvweapon)
                    setElementData(el,"MysliwyStrzelanie",false,false)
                    setElementData(el,"player:job",false)
                    triggerClientEvent(el,"MysliwyStop",resourceRoot)
                    outputChatBox("Odda?e? bro?, praca zako?czona!",el,0,255,0)
                end
            end
            return
        end
        if getElementData(el,"player:license:Strzelanie") == 0 then
            outputChatBox("* Nie posiadasz zdanej licencji na bro?!"el25500)
            return
        end
        giveWeapon(el,33,1000)
        setElementData(el,"MysliwyStrzelanie",{fire=isControlEnabled(el,"fire"),aim=isControlEnabled(el,"aim_weapon"),nexweapon=isControlEnabled(el,"next_weapon"),prvweapon=isControlEnabled(el,"previous_weapon")},false)
        toggleControl(el,"fire",true)
        toggleControl(el,"aim_weapon",true)
        toggleControl(el,"next_weapon",true)
        toggleControl(el,"previous_weapon",true)
        setElementData(el,"player:job",code)
        outputChatBox("Otrzyma?e? bro?, zacznij od poszukania zwierzyny.",el,0,255,0)
        triggerClientEvent(el,"MysliwyStart",resourceRoot)
    end
end
addEventHandler("onMarkerHit",resourceRoot,MarkerHit)

function onLeave(hitelement)
    if getElementType(hitelement)=="player" and getElementData(hitelement,"player:job")==code then
        removePedFromVehicle(hitelement)
        setTimer(function(p)
            setElementPosition(p,-1635.01, -2238.4831.48)
            outputChatBox("Zbytnio oddali?e? si? od miejsca ?ow?w! Je?li chcesz zako?czy? prac?, wejd? w zielony marker!",p,255,0,0)
        end,100,1,hitelement)
    end
end
addEventHandler("onColShapeLeave",miejsce,onLeave)

function pedDmg(attacker)
    if attacker==localPlayer then
        source=getElementData(source,"parent")
        if source and getElementData(source,"zwierze"then
            wyplata=getElementData(source,"kasa")
            outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
            triggerClientEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
            id=getElementData(source,"id")
            destroyElement(getElementData(source,"parent"))
            destroyElement(source)
            stworzZwierzeta(false,1,id)
            aktualneZwierzeta[id]=nil
            sfery[id]=nil
            zajete[id]=nil
        end
    end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)


Jeszcze raz prosz? o pomoc :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-24, 21:26


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

No ja tu nie widze triggera "prace:wyplata"..

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-24, 22:44


Hiroszekk







Wiek: 24
Na forum: 3312 dni
Posty: 113
Nick w MP: Hiroszek

Piwa: 845

Respekt: -84,3

Ostrzeżeń: 20%
Widze prace z itsa.. wgraj prace-core znajduj?ce si? w [Prace] :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-24, 23:39


AssasiPlayGames







Wiek: 22
Na forum: 3757 dni
Posty: 176
Nick w MP: NiFeKpL

Piwa: 909

Respekt: 70,5

function start()
    mysliwystart=createMarker(-1632.57, -2245.4931.48-1,"cylinder",1.5,0,255,0,170)
    code="Mysliwy"
    miejsce=createColSphere(-1632.57, -2245.4931.48,600)
end
createBlip(-1632.57, -2245.4931.48,46)    
start()


function MarkerHit(el,md)
    if source==mysliwystart then
        if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
        job=getElementData(el,"player:job")
        if job then
            if job==code then
                data=getElementData(el,"MysliwyStrzelanie")
                if data then
                    takeWeapon(el,33,1000)
                    toggleControl(el,"fire",data.fire)
                    toggleControl(el,"aim_weapon",data.aim)
                    toggleControl(el,"next_weapon",data.nexweapon)
                    toggleControl(el,"previous_weapon",data.prvweapon)
                    setElementData(el,"MysliwyStrzelanie",false,false)
                    setElementData(el,"player:job",false)
                    triggerClientEvent(el,"MysliwyStop",resourceRoot)
                    outputChatBox("Odda?e? bro?, praca zako?czona!",el,0,255,0)
                end
            end
            return
        end
        if getElementData(el,"player:license:Strzelanie") == 0 then
            outputChatBox("* Nie posiadasz zdanej licencji na bro?!"el25500)
            return
        end
        giveWeapon(el,33,1000)
        setElementData(el,"MysliwyStrzelanie",{fire=isControlEnabled(el,"fire"),aim=isControlEnabled(el,"aim_weapon"),nexweapon=isControlEnabled(el,"next_weapon"),prvweapon=isControlEnabled(el,"previous_weapon")},false)
        toggleControl(el,"fire",true)
        toggleControl(el,"aim_weapon",true)
        toggleControl(el,"next_weapon",true)
        toggleControl(el,"previous_weapon",true)
        setElementData(el,"player:job",code)
        outputChatBox("Otrzyma?e? bro?, zacznij od poszukania zwierzyny.",el,0,255,0)
        triggerClientEvent(el,"MysliwyStart",resourceRoot)
    end
end
addEventHandler("onMarkerHit",resourceRoot,MarkerHit)

function onLeave(hitelement)
    if getElementType(hitelement)=="player" and getElementData(hitelement,"player:job")==code then
        removePedFromVehicle(hitelement)
        setTimer(function(p)
            setElementPosition(p,-1635.01, -2238.4831.48)
            outputChatBox("Zbytnio oddali?e? si? od miejsca ?ow?w! Je?li chcesz zako?czy? prac?, wejd? w zielony marker!",p,255,0,0)
        end,100,1,hitelement)
    end
end
addEventHandler("onColShapeLeave",miejsce,onLeave)

function pedDmg(attacker)
    if attacker==localPlayer then
        source=getElementData(source,"parent")
        if source and getElementData(source,"zwierze"then
            wyplata=getElementData(source,"kasa")
            outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
            triggerClientEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
            id=getElementData(source,"id")
            destroyElement(getElementData(source,"parent"))
            destroyElement(source)
            stworzZwierzeta(false,1,id)
            aktualneZwierzeta[id]=nil
            sfery[id]=nil
            zajete[id]=nil
        end
    end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)

addEvent("prace:wyplata",true)
addEventHandler("prace:wyplata",root,function(ilosc)
    givePlayerMoney(client,ilosc)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-25, 00:46


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"AssasiPlayGames" napisał/a:

function start()
    mysliwystart=createMarker(-1632.57, -2245.4931.48-1,"cylinder",1.5,0,255,0,170)
    code="Mysliwy"
    miejsce=createColSphere(-1632.57, -2245.4931.48,600)
end
createBlip(-1632.57, -2245.4931.48,46)    
start()


function MarkerHit(el,md)
    if source==mysliwystart then
        if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
        job=getElementData(el,"player:job")
        if job then
            if job==code then
                data=getElementData(el,"MysliwyStrzelanie")
                if data then
                    takeWeapon(el,33,1000)
                    toggleControl(el,"fire",data.fire)
                    toggleControl(el,"aim_weapon",data.aim)
                    toggleControl(el,"next_weapon",data.nexweapon)
                    toggleControl(el,"previous_weapon",data.prvweapon)
                    setElementData(el,"MysliwyStrzelanie",false,false)
                    setElementData(el,"player:job",false)
                    triggerClientEvent(el,"MysliwyStop",resourceRoot)
                    outputChatBox("Odda?e? bro?, praca zako?czona!",el,0,255,0)
                end
            end
            return
        end
        if getElementData(el,"player:license:Strzelanie") == 0 then
            outputChatBox("* Nie posiadasz zdanej licencji na bro?!"el25500)
            return
        end
        giveWeapon(el,33,1000)
        setElementData(el,"MysliwyStrzelanie",{fire=isControlEnabled(el,"fire"),aim=isControlEnabled(el,"aim_weapon"),nexweapon=isControlEnabled(el,"next_weapon"),prvweapon=isControlEnabled(el,"previous_weapon")},false)
        toggleControl(el,"fire",true)
        toggleControl(el,"aim_weapon",true)
        toggleControl(el,"next_weapon",true)
        toggleControl(el,"previous_weapon",true)
        setElementData(el,"player:job",code)
        outputChatBox("Otrzyma?e? bro?, zacznij od poszukania zwierzyny.",el,0,255,0)
        triggerClientEvent(el,"MysliwyStart",resourceRoot)
    end
end
addEventHandler("onMarkerHit",resourceRoot,MarkerHit)

function onLeave(hitelement)
    if getElementType(hitelement)=="player" and getElementData(hitelement,"player:job")==code then
        removePedFromVehicle(hitelement)
        setTimer(function(p)
            setElementPosition(p,-1635.01, -2238.4831.48)
            outputChatBox("Zbytnio oddali?e? si? od miejsca ?ow?w! Je?li chcesz zako?czy? prac?, wejd? w zielony marker!",p,255,0,0)
        end,100,1,hitelement)
    end
end
addEventHandler("onColShapeLeave",miejsce,onLeave)

function pedDmg(attacker)
    if attacker==localPlayer then
        source=getElementData(source,"parent")
        if source and getElementData(source,"zwierze"then
            wyplata=getElementData(source,"kasa")
            outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
            triggerClientEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
            id=getElementData(source,"id")
            destroyElement(getElementData(source,"parent"))
            destroyElement(source)
            stworzZwierzeta(false,1,id)
            aktualneZwierzeta[id]=nil
            sfery[id]=nil
            zajete[id]=nil
        end
    end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)

addEvent("prace:wyplata",true)
addEventHandler("prace:wyplata",root,function(ilosc)
    givePlayerMoney(client,ilosc)
end)

dodaj ten event po stronie 'server' i powinno by? spoko, aczkolwiek client w givePlayerMoney zamie? na localPlayer

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: myśliwego
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku