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

Wysłany: 2019-07-18, 15:58


Pyrek24







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

Piwa: 10

Respekt: 50

Witam ot?? zrobi?em sobie element date. Lecz nwm jak to zrobi? poprawnie.
Ot?? chcia?bym aby osoba kt?ra wesz?a w pickup i mia?a t? element dat? to daje jej bro?, a osoba kt?ra nie ma element daty nie dostaje nic.
element data
getElementData(localPlayer,"player:ak47") ~= 0

pickup
local uzi=createPickup(100.39,1904.01,30.052285000500)

kod strefa dm

bronieFire = {
 -- Bronie z kt?rych mo?na strzelac robizdj?cia .. ITD
[23] = true, -- Paralizator
[24] = true, -- Deagle
[38] = true, -- Minigun
[41] = true, -- Spray
[42] = true, -- Ga?nica
[46] = true, -- Aparat
[35] = true, -- Dildo
[9] = true, -- Dildo
[43] = true, -- Camera
[25] = true, -- ShotGun
[8] = true, -- siekiera
[3] = true, -- pa?a sapd
[16] = true, -- granat
[34] = true, -- Sniper
[30] = true, -- ak
[31] = true, -- ak
[29] = true, -- ak
[17] = true, -- ak

}
bronieAim = {
-- Bronie z
[22] = true, -- Suszarka
[46] = true, -- SuszarkaPol
}

bronieSkin = {
[284]={[30]=true,[31]=true,[29]=true,[25]=true,[3]=true},
[285]={[30]=true,[31]=true,[29]=true,[25]=true,[3]=true},
[286]={[30]=true,[31]=true,[29]=true,[25]=true,[3]=true},
[247]={[0]=true},
}


local isDm true
local strefaDM createColCuboid(-2698.842144.21, -57.11526.66440.49278.76) -- GROVE STREET LS
local strefaDMradar createRadarArea (-2698.112144.71530,530000120 )

addEventHandler("onClientRender",root,function()
    if bronieAim[getPedWeapon(localPlayer)] and not isPedInVehicle(localPlayerthen
        toggleControl("aim_weapon",true)
        toggleControl("fire",false)
    elseif isCursorShowing() then
        toggleControl("fire",false)
        toggleControl("aim_weapon",false)
    elseif bronieSkin[getElementModel(localPlayer)] and bronieSkin[getElementModel(localPlayer)][getPedWeapon(localPlayer)] == true then
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("action",true)
    elseif isElementInWater(localPlayerthen -- ?eby gracz m?gnurkowa?
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("action",true)
    elseif bronieFire[getPedWeapon(localPlayer)] then
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("action",true)
    elseif getElementData(localPlayer"dmstatus") == "on" then
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("action",true)
    elseif isDm and getElementData(localPlayer,"strefaDM")  then
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("action",true)
    elseif getElementData(localPlayer,"dmstatus") == "on" or getElementData(localPlayer,"driveBy"then
        toggleControl("fire",true)
        toggleControl("aim_weapon",true)
        toggleControl("vehicle_secondary_fire",true)
        toggleControl("action",true)
    elseif isPedInVehicle(localPlayerthen
        local veh=getPedOccupiedVehicle(localPlayer)
        if veh and getElementModel(veh)==4999 and tonumber(getElementData(veh,"zapelnienie:wody")) > 100 then
            toggleControl("fire",true)
            toggleControl("aim_weapon",true)
            toggleControl("action",true)
        else
            if getElementData(localPlayer,"dmstatus") == "on" or getElementData(localPlayer,"driveBy"then
                toggleControl("fire",true)
                toggleControl("aim_weapon",true)
                toggleControl("action",true)
            else
                toggleControl("fire",false)
                toggleControl("aim_weapon",false)
                toggleControl("action",true)
            end
        end
            toggleControl("aim_weapon",true)
            toggleControl("fire",false)
            toggleControl("action",false)
        else
            toggleControl("fire",false)
            toggleControl("aim_weapon",false)
            toggleControl("action",false)
    end
end)


setElementData(localPlayer,"strefaDM",false)
addEventHandler("onClientColShapeHit",resourceRoot,function()
    if isDm and not getElementData(localPlayer,"strefaDM") and getElementDimension(localPlayer) == and getElementInterior(localPlayer) == and source == strefaDM and isElementWithinColShape(localPlayer,strefaDM) and getElementData(localPlayer,"player:uid"then
        setElementData(localPlayer,"strefaDM",isDm)
        setRadarAreaFlashing strefaDMradartrue )
        triggerEvent("onClientAddNotification"localPlayer"WKROCZY?E?/A? NA STREFE DM !!!""info")
        triggerEvent("onClientAddNotification"localPlayer"WKROCZY?E?/A? NA STREFE DM !!!""info")
    end
end)



addEventHandler("onClientColShapeLeave",resourceRoot,function()
    if isDm and getElementData(localPlayer,"strefaDM") and source == strefaDM and not isElementWithinColShape(localPlayer,strefaDM) and getElementData(localPlayer,"player:uid"then
        setElementData(localPlayer,"strefaDM",false)
        setRadarAreaFlashing strefaDMradarfalse )
        triggerEvent("onClientAddNotification"localPlayer"Opu?ci?e? StrefeDM. Uff""info")
        triggerEvent("onClientAddNotification"localPlayer"Opu?ci?e? StrefeDM. Uff""info")        
    end
end)


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-18, 18:37


Gravgor







Wiek: 22
Na forum: 3620 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

Napisz to normalnie, bo nic z tego nie rozumiem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-18, 19:45


Pyrek24







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

Piwa: 10

Respekt: 50

Chcia?bym by osoby z element dat? ak47, dostawa?y bro? po wej?ciu w pickup.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-18, 23:30


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

if getElementData(localPlayer,"player:ak47"then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-19, 12:01


Pyrek24







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

Piwa: 10

Respekt: 50


if getElementData(localPlayer,"player:ak47"then
local uzi=createPickup(100.39,1904.01,30.052285000500) return end 

Tak Wilq ?

Postaw piwo autorowi tego posta
 

 
Tagi: bronie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Bronie 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