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

Wysłany: 2023-05-14, 10:04


Jub00x







Wiek: 23
Na forum: 1356 dni
Posty: 7
Nick w MP: xXJuBoXx

Piwa: 11

Respekt: 50

Uzywam paczki nitrorpg, i skrypt od respienia po smierci, wywala mi taki blad w trakcie gdy juz jestem po BW i wstaje na nogi, skin zmienia sie na skina 0 ( cj)
local strefa =  createColRectangle1959.3610839844, -1826.88427734381035.34985351562300.19055175781)
local skillstable = { 69707172737476777879 }
local weaponstable = { 2425303128}

addEventHandler("onColShapeHit"strefa, function(el)
    if getElementType(el) == "player" then
        reloadDMInfo(el)
        toggleControl(el"fire"true)
        toggleControl(el"aim_weapon"true)
        setElementData(el"player:strefaDM"true)
        exports.nrpg_interface:showPlayerNotification(el'Wchodzisz do strefy bezprawia''info'15000)

        
        local saveSkin getElementModel(el)
        if saveSkin == 49 then
            setElementData(el"dmSaveSkin"saveSkin)
        end

        if not getElementData(el"player:faction"then
            for _stat in ipairs(skillstable) do
                setPedStat(elstat1000)
            end

            for _weapon in ipairs(weaponstable) do
                giveWeapon(elweapon9999)

                if weapon == 24 then
                    giveWeapon(el249999true)
                end
            end
        end
    end
end)

addEventHandler("onColShapeLeave"strefa, function(el)
    if getElementType(el) == "player" then
        reloadDMInfo(el)

        if not getElementData(el"player:faction"then
            if getElementData(el"player:level") ~= 5 then
                toggleControl(el"fire"false)
                toggleControl(el"aim_weapon"false)
            else
                giveWeapon(el229999)
                setPedStat(el690)
            end
            takeAllWeapons(el)
        end

        local saveSkin getElementData(el"dmSaveSkin")
        if saveSkin then
            setElementModel(elsaveSkin)
        end
        
        setElementData(el"player:strefaDM"false)
        exports.nrpg_interface:showPlayerNotification(el'Wychodzisz ze strefy bezprawia''info'15000)
    end
end)

addEventHandler "onPlayerWasted"root, function(ammokillerkillerweaponbodypart)
    if ( killer ) and ( killer ~= source ) and getElementData(source"player:sid") and getElementData(killer"player:sid"then
        local playerRespekt math.random(1,2)
        local organizationRespekt math.random(5,6)

        if getElementData(killer"player:organization"then
            exports.nrpg_interface:showPlayerNotification(killer'Zabito gracza '..getPlayerName(source)..', otrzymujesz: '..playerRespekt..' pkt. respektu, twoja organizacja otrzymuje: '..organizationRespekt..' pkt. respektu''success'15000)
            exports["nrpg_db"]:dbSet("UPDATE pystories_organizacje_info SET punkty=punkty+? WHERE nazwa=?"organizationRespektgetElementData(killer"player:organization"))    
        else
            exports.nrpg_interface:showPlayerNotification(killer'Zabito gracza '..getPlayerName(source)..', otrzymujesz: '..playerRespekt..' pkt. respektu''success'15000)
        end
        exports["nrpg_db"]:dbSet("UPDATE pystories_users SET respekt=respekt+? WHERE id=?"playerRespektgetElementData(killer"player:sid"))    

        local playerDieRespekt 1
        local organizationDieRespekt math.random(3,4)
        if getElementData(source"player:organization"then
            exports.nrpg_interface:showPlayerNotification(source'Zosta?‚e?›/a?› zabity/a przez '..getPlayerName(killer)..', tracisz: '..playerDieRespekt..' pkt. respektu, twoja organizacja traci: '..organizationDieRespekt..' pkt. respektu''error'15000)
            exports["nrpg_db"]:dbSet("UPDATE pystories_organizacje_info SET punkty=punkty-? WHERE nazwa=?"organizationDieRespektgetElementData(source"player:organization"))    
        else
            exports.nrpg_interface:showPlayerNotification(source'Zosta?‚e?›/a?› zabity/a przez '..getPlayerName(killer)..', tracisz: '..playerDieRespekt..' pkt. respektu''error'15000)
        end
        exports["nrpg_db"]:dbSet("UPDATE pystories_users SET respekt=respekt-? WHERE id=?"playerDieRespektgetElementData(source"player:sid"))    
    end
    triggerClientEvent(source"oknoNieprzytomnosci"source)
    reloadDMInfo(killer)
    reloadDMInfo(source)
end)

function healGod(plrloss)
    local actualHealth getElementHealth(plr)
    setElementHealth(plractualHealth+loss)
end

addEventHandler("onPlayerDamage"root, function(attacker,attackerweapon,bodypart,loss)
    if getElementData(source"player:safeDM"then
            healGod(sourceloss)
        return
    end

    if isElementWithinColShape(sourcestrefathen
        if bodypart == 9 then
            local actualHealth getElementHealth(source)
            if actualHealth 5 then
                killPlayer(sourceattackerattackerweaponbodypart)
            else
                setElementHealth(sourceactualHealth-math.random(30,50))
            end
        end
    end
end)

addEvent("zrespZmarlego"true)
addEventHandler("zrespZmarlego"root, function()
    local xygetElementPosition(source)
    spawnPlayer(sourcexyz)
    setCameraTarget(sourcesource)
    setElementData(source"safe:bw"true)

    if getElementData(source"player:strefaDM"then
        for _weapon in ipairs(weaponstable) do
            giveWeapon(sourceweapon9999)

            if weapon == 24 then
                giveWeapon(source249999true)
            end
        end

        setElementAlpha(source200)
        setElementData(source"player:safeDM"true)
        exports.nrpg_interface:showPlayerNotification(source'Otrzymujesz ochron?™ na 15 sekund, nie moĹĽesz by?‡ zabity/a''info'15000)
        plr source

        setTimer( function()
            if plr then
                setElementAlpha(plr255)
                setElementData(plr"player:safeDM"false)
            end
        end150001)
    end
end)

for i,v in ipairs(getElementsByType("player")) do
    if isPedDead(vthen
        triggerEvent("zrespZmarlego"v)
        setElementData(v"player:bw"false)
        setElementData(v"notshowhud"false)
    end
    
    
    if getElementData(v"player:safeDM"then
        setElementAlpha(v255)
        toggleControl(v"fire"true)
        toggleControl(v"aim_weapon"true)
        setElementData(v"player:safeDM"false)
    end
end

addEvent("deleteSafeBW"true)
addEventHandler("deleteSafeBW"root, function(plr)
    setElementAlpha(plr255)
    toggleControl(plr"fire"true)
    toggleControl(plr"aim_weapon"true)
    setElementData(plr"player:safeDM"false)
    exports.nrpg_interface:showPlayerNotification(plr'Ochrona wy?‚?…czona''error'15000)
end)

function reloadDMInfo(plr)
    local player_sid getElementData(plr"player:sid")

    if player_sid then
        if getElementData(plr"player:organization"then
            local result exports["nrpg_db"]:dbGet("SELECT * FROM pystories_users WHERE id=?"player_sid)
            local result2 exports["nrpg_db"]:dbGet("SELECT * FROM pystories_organizacje_info WHERE nazwa=?"getElementData(plr"player:organization"))
            triggerClientEvent(plr"dmInfoReloadClient"plrresult[1].respektresult2[1].punkty)
        else
            local result exports["nrpg_db"]:dbGet("SELECT * FROM pystories_users WHERE id=?"player_sid)
            triggerClientEvent(plr"dmInfoReloadClient"plrresult[1].respekt0)
        end
    end
end



a tutaj caly kod, blad jest w 167 linijce.

Komentarz N0TH1NG dodany 2023-05-14, 10:32Dodałem tagi [lua][/lua]
Ostatnio zmieniony przez N0TH1NG 2023-05-14, 10:31, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-05-14, 20:37


MlodyRafonix







Wiek: 26
Na forum: 1899 dni
Posty: 103

Piwa: 954

Respekt: 60

local player_sid getElementData(plr"player:sid")


Zapewne nie masz takiej element daty.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-05-15, 20:37


Jub00x







Wiek: 23
Na forum: 1356 dni
Posty: 7
Nick w MP: xXJuBoXx

Piwa: 11

Respekt: 50

"MlodyRafonix" napisał/a:

local player_sid getElementData(plr"player:sid")


Zapewne nie masz takiej element daty.


takowa jest zapisana w core

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-05-16, 18:03


MlodyRafonix







Wiek: 26
Na forum: 1899 dni
Posty: 103

Piwa: 954

Respekt: 60

"Jub00x" napisał/a:

takowa jest zapisana w core


To dodaj:

outputChatBox(inspect(getElementData(plr"player:sid")))


I daj zna? :)

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-05-17, 06:57


Jub00x







Wiek: 23
Na forum: 1356 dni
Posty: 7
Nick w MP: xXJuBoXx

Piwa: 11

Respekt: 50

"MlodyRafonix" napisał/a:

"Jub00x" napisał/a:

takowa jest zapisana w core


To dodaj:

outputChatBox(inspect(getElementData(plr"player:sid")))


I daj zna? :)



Dzi?ki za pomoc, ale znalaz?em ju? nowy skrypt na bw, ten dzialal razem ze strefa DM.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: skin :: smierci :: sie :: nie :: wczytuje
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