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

Wysłany: 2019-02-19, 10:46


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? pomo?e mi kto?, bo chce ?e jak wyjdziemy z strefy DM zabierze nam bro?, pom?g?by kto?>?
kod
local area=createRadarArea(-123.19,1653.115204504500040)
--2918.59,-896.90
setRadarAreaFlashing(areatrue)

local strefa createColRectangle(-123.19,1653.11520450)

local strefa createColCuboid(758.02,8.2,999.705.55.53) -- SiÅ‚ownia
setElementDimension(strefa31)

addEventHandler("onColShapeHit"resourceRoot,
  function(plr,dim)
    if (getElementType(plr) == "player"then
        if dim then
            if getElementDimension(plr)==0 then
                if getElementInterior(plr) == 0 then 
                    setElementData(plr"strefadm"true)
                    exports["es-komunikaty"]:komunikat("Wchodzisz do strefy DM."plr)
                    
                    if getElementData(plr"kajdanki") or getElementData(plr"delikwent"then
                        return
                    end
                    if not isControlEnabled(plr"enter_exit") and isPedInVehicle(plrthen
                        return
                    end
                        toggleControl(plr"fire"true)
                        toggleControl(plr"aim_weapon"true)
                end
            end
        end
    end
  end
)

addEventHandler("onColShapeLeave"resourceRoot,
  function(plr,dim)
    if (getElementType(plr) == "player"then
            if dim then
                if getElementData(plr,"Policja:sluzba"then
                    setElementData(plr"strefadm"false)
                    exports["es-komunikaty"]:komunikat("Wychodzisz ze strefy DM."plr)
                    return
                end
                setControlState(plr"fire"false)
                toggleControl(plr"fire"false)
                toggleControl(plr"aim_weapon"false)
                setElementData(plr"strefadm"false)
                exports["es-komunikaty"]:komunikat("Wychodzisz ze strefy DM."plr)
            end
    end
  end
)

-- bronie na DM

local zycia = {
{208.19,1920.42,17.64},
{224.71,1861.52,13.15},
{234.63,1712.03,22.64},
{356.17,1993.49,29.83},
}

local kastet createPickup(-55.49,2049.48,17.7821150001)

local katana createPickup(11.24,1720.74,22.6328150001)

local pila createPickup(201.89,1858.57,13.1429150001)

local shotgun createPickup(206.13,1921.31,17.642251500090)

local shotgun2 createPickup(255.25,1701.46,22.632271500090)

local sniperka createPickup(161.97,1932.53,33.90234150003)

local m4=createPickup(207.20,1917.69,17.642315000500)

local uzi=createPickup(202.15,1873.86,13.142285000500)

local uzi=createPickup(100.39,1904.01,30.052285000500)

for iv in pairs(zycia) do
    local zycie createPickup(v[1], v[2], v[3], 01007500)
end


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-19, 16:48


BlueCry

ŚĆRIPTER LUJA






Wiek: 25
Na forum: 4006 dni
Posty: 78
Nick w MP: BlueCry

Piwa: 2176

Respekt: 110
Respekt: 110

Masz tutaj poprawiony kod, powinno zabiera? wszystkie bronie.
local area=createRadarArea(-123.19,1653.115204504500040)
--2918.59,-896.90
setRadarAreaFlashing(areatrue)

local strefa createColRectangle(-123.19,1653.11520450)

local strefa createColCuboid(758.02,8.2,999.705.55.53) -- SiÅ‚ownia
setElementDimension(strefa31)

addEventHandler("onColShapeHit"resourceRoot,
  function(plr,dim)
    if (getElementType(plr) == "player"then
        if dim then
            if getElementDimension(plr)==0 then
                if getElementInterior(plr) == 0 then 
                    setElementData(plr"strefadm"true)
                    exports["es-komunikaty"]:komunikat("Wchodzisz do strefy DM."plr)
                    
                    if getElementData(plr"kajdanki") or getElementData(plr"delikwent"then
                        return
                    end
                    if not isControlEnabled(plr"enter_exit") and isPedInVehicle(plrthen
                        return
                    end
                        toggleControl(plr"fire"true)
                        toggleControl(plr"aim_weapon"true)
                end
            end
        end
    end
  end
)

addEventHandler("onColShapeLeave"resourceRoot,
  function(plr,dim)
    if (getElementType(plr) == "player"then
            if dim then
                if getElementData(plr,"Policja:sluzba"then
                    setElementData(plr"strefadm"false)
                    exports["es-komunikaty"]:komunikat("Wychodzisz ze strefy DM."plr)
                    return
                end
                setControlState(plr"fire"false)
                toggleControl(plr"fire"false)
                toggleControl(plr"aim_weapon"false)
                setElementData(plr"strefadm"false)
                takeAllWeapons plr )  
                exports["es-komunikaty"]:komunikat("Wychodzisz ze strefy DM."plr)
            end
    end
  end
)

-- bronie na DM

local zycia = {
{208.19,1920.42,17.64},
{224.71,1861.52,13.15},
{234.63,1712.03,22.64},
{356.17,1993.49,29.83},
}

local kastet createPickup(-55.49,2049.48,17.7821150001)

local katana createPickup(11.24,1720.74,22.6328150001)

local pila createPickup(201.89,1858.57,13.1429150001)

local shotgun createPickup(206.13,1921.31,17.642251500090)

local shotgun2 createPickup(255.25,1701.46,22.632271500090)

local sniperka createPickup(161.97,1932.53,33.90234150003)

local m4=createPickup(207.20,1917.69,17.642315000500)

local uzi=createPickup(202.15,1873.86,13.142285000500)

local uzi=createPickup(100.39,1904.01,30.052285000500)

for iv in pairs(zycia) do
    local zycie createPickup(v[1], v[2], v[3], 01007500)
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Tagi: wychodzenie :: cuboidu :: oraz :: zabieranie :: broni
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Wychodzenie z Cuboidu oraz zabieranie broni Odpowiedz do tematu

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