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

Wysłany: 2018-01-12, 10:37


TheXenon







Wiek: 28
Na forum: 3498 dni
Posty: 15
Nick w MP: TheXenon



Respekt: 40,5

Problem jest taki

[2018-01-12 10:35] ERROR: Client (TheXenon) triggered serverside event montazElementu, but event is not added serverside

nie moge zamontowa? cz??ci do pojazdu

Skrypt: Tuner z SkyGame.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-12, 11:56


Czesio.







Wiek: 33
Na forum: 3586 dni
Posty: 34



Respekt: 45,3

dodawa?e? co? od siebie ? skrypty itp ?? bo jak testowa?em skygame wszystko dzia?a?o nalezycie .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-12, 14:55


Ciastuuś

As-salamu alaykum






Wiek: 27
Na forum: 3212 dni
Posty: 800
Nick w MP: Ciastuuś

Piwa: 4304

Respekt: 640
Respekt: 640Respekt: 640

Je?eli si? nie myl? to ten kod po stronie server'a spe?nia Twoje oczekiwanie monta?u tuningu na poje?dzie

niewspiera_tuningu = {
[503] = true,
}
addEvent("montazElementu", true)
addEventHandler("montazElementu", root, function(veh, typ, czesc, koszt, nazwaCzesci)
    if tostring(typ) == "naprawa" then
        zgoda=true
        zgoda2=false
        if czesc == "all" then
            setElementHealth(veh, 10000)
            fixVehicle(veh)
            setElementHealth(veh, 10000)
            setVehicleDoorState(veh, 0, 0)
            setVehicleDoorState(veh, 1, 0)
            setVehicleDoorState(veh, 2, 0)
            setVehicleDoorState(veh, 3, 0)
            setVehicleDoorState(veh, 4, 0)
            setVehicleDoorState(veh, 5, 0)
            setVehiclePanelState(veh, 4, 0)
            setVehiclePanelState(veh, 5, 0)
            setVehiclePanelState(veh, 6, 0)
            setVehicleLightState(veh, 0, 0)
            setVehicleLightState(veh, 1, 0)
            setVehicleLightState(veh, 2, 0)
            setVehicleLightState(veh, 3, 0)
        else
            if czesc == 1 then setElementHealth(veh, 10000) end
            if czesc == 2 then setVehicleDoorState(veh, 0, 0) end
            if czesc == 3 then setVehicleDoorState(veh, 1, 0) end
            if czesc == 4 then setVehicleDoorState(veh, 2, 0) end
            if czesc == 5 then setVehicleDoorState(veh, 3, 0) end
            if czesc == 6 then setVehicleDoorState(veh, 4, 0) end
            if czesc == 7 then setVehicleDoorState(veh, 5, 0) end
            if czesc == 8 then setVehiclePanelState(veh, 4, 0) end
            if czesc == 9 then setVehiclePanelState(veh, 5, 0) end
            if czesc == 10 then setVehiclePanelState(veh, 6, 0) end
            if czesc == 11 then setVehicleLightState(veh, 0, 0) end
            if czesc == 12 then setVehicleLightState(veh, 1, 0) end
            if czesc == 13 then setVehicleLightState(veh, 2, 0) end
            if czesc == 14 then setVehicleLightState(veh, 3, 0) end
        end
    end
    local id=getElementData(veh,"vehicle:id")
    if not id then return end
    if tostring(typ) == "swiatla" then
        zgoda=true
        zgoda2=false
        takePlayerMoney(client,koszt)
        setVehicleHeadLightColor(veh, czesc[1], czesc[2], czesc[3])
        query=string.format("UPDATE ogrpg_vehicles SET headlights='%d,%d,%d' WHERE id=?", czesc[1], czesc[2], czesc[3], id)
        exports["ogrpg-db"]:dbSet(query) -- set rekords
    end
    if tostring(typ) == "kolor" then
        zgoda=false
        zgoda2=false
        local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12=getVehicleColor(veh, true)
        setVehicleColor(veh, czesc[1], czesc[2], czesc[3],c4,c5,c6,c7,c8,c9,c10,c11,c12)
        query=string.format("UPDATE ogrpg_vehicles SET color='%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d' WHERE id=?", czesc[1], czesc[2], czesc[3],c4,c5,c6,c7,c8,c9,c10,c11,c12, id)
        exports["ogrpg-db"]:dbSet(query) -- set rekords
    end
    if tostring(typ) == "kolor2" then
        zgoda=false
        zgoda2=false
        local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12=getVehicleColor(veh, true)
        setVehicleColor(veh, c1,c2,c3,czesc[1], czesc[2], czesc[3],c7,c8,c9,c10,c11,c12)
        query=string.format("UPDATE ogrpg_vehicles SET color='%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d' WHERE id=?", c1,c2,c3,czesc[1], czesc[2], czesc[3],c7,c8,c9,c10,c11,c12, id)
        exports["ogrpg-db"]:dbSet(query) -- set rekords
    end
    if tostring(typ) == "tuning" then
        if niewspiera_tuningu[getElementModel(veh)] then outputChatBox("* Tego pojazdu nie mozesz tuningowa?!",client) return end
        if getPlayerMoney(client)<tonumber(koszt) then
            local brakhajsu = string.format("*Nie sta? ci? na %s brakuj? ci %d PLN", nazwaCzesci, tonumber(koszt)-getPlayerMoney(client))
            outputChatBox(brakhajsu, client)
        return end
        local driver=getVehicleController(veh)
        if driver then
            removeVehicleUpgrade(veh,czesc)
            outputChatBox("* Zamontowano cz??c:"..nazwaCzesci.."("..czesc.."), koszt: "..koszt.." PLN'?w", driver)
        else
            outputChatBox("* Brak kierowcy w pojedzie", client) return
        end
        takePlayerMoney(client, koszt)
        zgoda=true
        zgoda2=false
        addVehicleUpgrade(veh, czesc)
        upgrades=getVehicleUpgrades(veh)
        if not upgrades then upgrades={} end
        upgrades=table.concat(upgrades, ",")
        query=string.format("UPDATE ogrpg_vehicles SET tuning='%s' WHERE id=?", upgrades, id)
        exports["ogrpg-db"]:dbSet(query) -- set rekords
    end
    if tostring(typ) == "demtuning" then
        driver=getVehicleController(veh)
        if not driver then outputChatBox("* Brak kierowcy w pojedzie", client) return end
        if getElementData(veh,"vehicle:ownedPlayer") ~= getElementData(driver,"player:uid") then outputChatBox("* Kierowca nie jest w?ascicielem!",client) return end
        if removeVehicleUpgrade(veh,czesc) == true then
            if driver then
                removeVehicleUpgrade(veh,czesc)
                givePlayerMoney(driver,koszt)
                outputChatBox("* Zdemontowano cz??c: "..nazwaCzesci.."("..czesc.."), zwrot: "..koszt.." PLN'?w", driver)
            end
            zgoda=false
            zgoda2=true
            upgrades=getVehicleUpgrades(veh)
            if not upgrades then upgrades={} end
            upgrades=table.concat(upgrades, ",")
            query=string.format("UPDATE ogrpg_vehicles SET tuning='%s' WHERE id=?", upgrades, id)
            exports["ogrpg-db"]:dbSet(query) -- set rekords
        end
    end
    if zgoda == true then
        text="WARSZTAT Zamontowano "..typ..", dla pojazdu id "..id..", koszt "..koszt.." PLN'?w"
        triggerClientEvent("onDebugMessage", resourceRoot, text,5, "INNE")
        triggerEvent("admin:logs", root, text)
    end
    if zgoda2 == true then
        text="WARSZTAT Zdemontowano "..czesc..", dla pojazdu id "..id..", koszt "..koszt.." PLN'?w"
        triggerClientEvent("onDebugMessage", resourceRoot, text,5, "INNE")
        triggerEvent("admin:logs", root, text)
    end
end)


Postaw piwo autorowi tego posta
 

 
Tagi: czemu :: tuner :: nie :: działa?
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