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

Wysłany: 2018-09-16, 17:27


rzepa0







Wiek: 28
Na forum: 2980 dni
Posty: 3

Piwa: 1

Respekt: 50

Witam , nie wiem czy w dobrym dziale pisze, mianowicie mam problem z pojazdami wszystmo ?adnie dzia?a lecz gdy pojazd uderzy w co? to znika mi menu tzn. Nie mo?na go naprawi? nie mo?na zatankowa? itp, mia? kto? podobny problem?
Odwdzi?cz? sie za pomoc 😊

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KosteQ010
Wysłany: 2018-09-16, 18:06


Allansso







Wiek: 25
Na forum: 4079 dni
Posty: 386

Piwa: 1546

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 100%
Podaj mo?e kod/paczk? dayz?

Podpis
https://www.youtube.com/TheMikol
https://www.facebook.com/TheMikol1337
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
rzepa0
Wysłany: 2018-09-16, 18:22


rzepa0







Wiek: 28
Na forum: 2980 dni
Posty: 3

Piwa: 1

Respekt: 50

local theTableMenuScroll = {}
function startRollMessageMenu(text, r, g, b, data)
    table.insert(theTableMenuScroll,{text,r,g,b,data})
end

vehicleAddonsInfo = {
-- {Model ID, Tires, Engine, Tank Parts}
{422,4,1,1},
{470,4,1,1},
{468,2,1,1},
{433,6,1,1},
{437,6,1,1},
{487,0,1,1},
{497,0,1,1},
{471,4,1,1},
{400,4,1,1},
{531,4,1,1},
{553,2,2,1},
{451,4,1,1},
{489,4,1,1},
{412,4,1,1},
{490,4,1,1},
{522,2,1,1},
{488,0,1,1},
{521,2,1,1},
{427,4,1,1},
{506,4,1,1},
{463,2,1,1},
{541,4,1,1},
{579,4,1,1},
{520,4,2,1},
{447,0,1,1},
}

function getVehicleAddonInfos (id)
    for i,veh in ipairs(vehicleAddonsInfo) do
        if veh[1] == id then
            return veh[2],veh[3], veh[4]
        end
    end
end

function dxDrawingColorTextMenuScroll(str, ax, ay, bx, by, color, alpha, scale, font, alignX, alignY)

  if alignX then
    if alignX == "center" then
    elseif alignX == "right" then
      local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font)
      ax = bx - w
    end
  end

  if alignY then
    if alignY == "center" then
      local h = dxGetFontHeight(scale, font)
      ay = ay + (by-ay)/2 - h/2
    elseif alignY == "bottom" then
      local h = dxGetFontHeight(scale, font)
      ay = by - h
    end
  end

  local pat = "(.-)#(%x%x%x%x%x%x)"
  local s, e, cap, col = str:find(pat, 1)
  local last = 1
  while s do
    if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end
    if s ~= 1 or cap ~= "" then
      local w = dxGetTextWidth(cap, scale, font)
      dxDrawText(cap, ax, ay, ax + w, by, color, scale, font)
      ax = ax + w
      color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha)
    end
    last = e + 1
    s, e, cap, col = str:find(pat, last)
  end
  if last <= #str then
    cap = str:sub(last)
    local w = dxGetTextWidth(cap, scale, font)
    dxDrawText(cap, ax, ay, ax + w, by, color, scale, font)
  end
end

local boxSpace = dxGetFontHeight(1,"default-bold")+dxGetFontHeight(1,"default-bold")*0.1

local optionsTable = {
["player"] = {
{"Give Painkillers"},
{"Give Bandage"},
{"Give Morphine"},
},
}
------------------------------------------------------------------------------
--MENU
function showClientMenuItem(arg1,arg2,arg3,arg4)
theTableMenuScroll = {}
setElementData(localPlayer,"usedItemTrue", false)
numberMenuScroll = 1
if arg1 == "Rzecz" then
    startRollMessageMenu("Rzecz "..arg2,50,255,50,arg2)
    setElementData(localPlayer,"usedItemTrue", true)
end
if arg1 == "stop" then
    disableMenu()
    refreshLoot(false)
end
if arg1 == "Helicrashsite" then
    startRollMessageMenu("Sprawd?",255,255,255,"helicrashsite")
    setElementData(localPlayer,"usedItemTrue", true)
end
if arg1 == "Hospitalbox" then
    startRollMessageMenu("Przeszukaj",255,255,255,"hospitalbox")
    setElementData(localPlayer,"usedItemTrue", true)
end
if arg1 == "Ammobox" then
    startRollMessageMenu("Przeszukaj",255,255,255,"Ammobox")
    setElementData(localPlayer,"usedItemTrue", true)
end
if arg1 == "safe" then
    startRollMessageMenu("Przeszukaj (Sejf): "..getLootCurrentSlots(arg4).."/"..(getElementData(arg4,"MAX_Slots") or 0).." Sejf",0,255,0,"opensafe")
    setElementData(localPlayer,"usedItemTrue", true)
    startRollMessageMenu("Usu? Sejf",0,255,0,"removesafe")
end
if arg1 == "Vehicle" then
    startRollMessageMenu("Przeszukaj: "..getLootCurrentSlots(arg4).."/"..(getElementData(arg4,"MAX_Slots") or 0).." Wyposa?enie ",0,255,0,"vehicle")
    setElementData(localPlayer,"usedItemTrue", true)
    if getElementData(getElementData(arg3,"parent"),"tent") then
        startRollMessageMenu("Usu? Namiot",0,255,0,"tent")
        return
    end
    --2
    if getElementHealth(arg3) < 1000 and getElementHealth(arg3) >= 50 then
        startRollMessageMenu("Napraw ("..vNameText.."): " ..tostring(math.floor(getElementHealth(arg3)/10)).."%",0,255,0,"repairvehicle")
        setElementData(localPlayer,"usedItemTrue", true)
    end
    
    if (getElementData(arg4,"fuel") or 0) < getVehicleMaxFuel(arg4) then
        startRollMessageMenu("Uzupe?nij Paliwo("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",255,0,0,"FuelOne")
        setElementData(localPlayer,"usedItemTrue", true)
    end
    
    if (getElementData(arg4,"fuel") or 0) >= 20 then
        startRollMessageMenu("Spu?? Paliwo ("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",255,255,0,"FuelTwo")
        setElementData(localPlayer,"usedItemTrue", true)
    end
    
    local tires,engine,parts = getVehicleAddonInfos (getElementModel(arg3))
    if (getElementData(arg4,"Ko?a_inVehicle") or 0) > 0 then
        startRollMessageMenu("Zdemontuj Ko?a ("..(getElementData(arg4,"Ko?a_inVehicle") or 0).."/"..tires..")",255,255,0,"TireTwo")
        setElementData(localPlayer,"usedItemTrue", true)
    end
    
    if (getElementData(arg4,"Silnik_inVehicle") or 0) > 0 then
        startRollMessageMenu("Zdemontuj Silnik ("..(getElementData(arg4,"Silnik_inVehicle") or 0).."/"..engine..")",255,255,0,"EngineTwo")
        setElementData(localPlayer,"usedItemTrue", true)
    end
    
    if (getElementData(arg4,"Czesci_inVehicle") or 0) > 0 then
        startRollMessageMenu("Zdemontuj Czesci ("..(getElementData(arg4,"Czesci_inVehicle") or 0).."/"..parts..")",255,255,0,"PartsTwo")
        setElementData(localPlayer,"usedItemTrue", true)
    end    
end
if arg1 == "Player" then
    --1
    if getElementData(arg2,"bleeding") > 0 and getElementData(getLocalPlayer(),"Banda?") >= 1 then
        startRollMessageMenu("Opatrz",255,255,255,"bandage")
        setElementData(localPlayer,"usedItemTrue", true)
    end    
    if getElementData(arg2,"blood") < 11900 and getElementData(getLocalPlayer(),"&#1055;&#1072;&#1082;&#1077;&#1090; &#1082;&#1088;&#1086;&#1074;&#1080;") >= 1 then
        startRollMessageMenu("Uzupe?nij krew",255,255,255,"giveblood")
        setElementData(localPlayer,"usedItemTrue", true)
    end
end
if arg1 == "Dead" then
    startRollMessageMenu("Przeszukaj ("..arg2..")",0,255,0,"dead")
    startRollMessageMenu("Zbadaj Cia?o",0,255,0,"deadreason")
    startRollMessageMenu("Ukryj Cia?o",0,255,0,"hidebody")
    setElementData(localPlayer,"usedItemTrue", true)
end
if arg1 == "Fireplace" then
    if getElementData(getLocalPlayer(),"Surowe Mi?so") >= 1 then
        startRollMessageMenu("Przygotuj mi?so",255,255,255,"fireplace")
        setElementData(localPlayer,"usedItemTrue", true)
    end
end
if arg1 == "patrol" then
    if getElementData(getLocalPlayer(),"Pusty Kanister") >= 1 then
        startRollMessageMenu("Nape?nij Kanister",255,255,255,"patrolstation")
        setElementData(localPlayer,"usedItemTrue", true)
    end    
end
if arg1 == "Wirefence" then
    if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
        startRollMessageMenu("Zwi? Drut",255,255,255,"wirefence")
        setElementData(localPlayer,"usedItemTrue", true)
    end    
end
if arg1 == "SandBags" then
   if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
        startRollMessageMenu("Usu? worki z piaskiem",255,255,255,"sandbags")
        setElementData(localPlayer,"usedItemTrue", true)
   end   
end
if arg1 == "Przeszukaj" then
    startRollMessageMenu("Przeszukaj",255,255,255,"itemloot")
    setElementData(localPlayer,"usedItemTrue", true)
end
end
numberMenuScroll = 1
addEvent("showClientMenuItem",true)
addEventHandler("showClientMenuItem",getLocalPlayer(),showClientMenuItem)

function PlayerScrollMenuLalitka (key,keyState,arg)
    if getElementData(localPlayer,"usedItemTrue") then
        if ( keyState == "down" ) then
            if arg == "up" then
                numberMenuScroll = numberMenuScroll-1
                if numberMenuScroll < 1 then
                    numberMenuScroll = #theTableMenuScroll
                end
            elseif arg == "down" then
                numberMenuScroll = numberMenuScroll+1
                if numberMenuScroll > #theTableMenuScroll then
                    numberMenuScroll = 1
                end
            end
        end
    end
end
bindKey ( "mouse_wheel_up", "down", PlayerScrollMenuLalitka, "up" )
bindKey ( "mouse_wheel_down", "down", PlayerScrollMenuLalitka, "down" )

function disableMenu()
theTableMenuScroll = {}
setElementData(localPlayer,"usedItemTrue", false)
setNewbieInfo (false,"","")
end
addEvent("disableMenu",true)
addEventHandler("disableMenu",getLocalPlayer(),disableMenu)

function getPlayerInCol(tab)
    for theKey,thePlayer in ipairs(tab) do
        if thePlayer ~= getLocalPlayer() then
            return true
        end
    end
    return false
end

isInFirePlace = false
function onPlayerTargetPickup (theElement)
if theElement == getLocalPlayer() then
    if getElementData(source,"parent") == getLocalPlayer() then return end
        local player = getPlayerInCol(getElementsWithinColShape ( source, "player" ))
        if getPedOccupiedVehicle(getLocalPlayer()) then
            return
        end
        isInFirePlace = false
        setElementData(getLocalPlayer(),"isInFirePlace",false)
        if getElementData(source,"player") then
            showClientMenuItem("Player",getElementData(source,"parent"))
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",false)
            return
        end
        if player then
            return
        end
        if getElementData(source,"patrolstation") then
            showClientMenuItem("patrol")
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",false)
            setNewbieInfo (true,"&#1040;&#1047;&#1057;","Nacisnij '-' lub 'scroll myszki' aby uzupe?ni? kanister!\n Musisz mie?: Pusty Kanister",source)
            return
        end
        if getElementData(source,"wirefence") then
            showClientMenuItem("Wirefence")
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",false)
            setNewbieInfo (true,"Wirefence","Nacisnij '-' lub 'scroll myszki' aby usun?? ogrodzenie!\n Musisz mie?: Narz?dzia",source)
            return
        end
        if getElementData(source,"sandbags") then
                showClientMenuItem("SandBags")
                setElementData(getLocalPlayer(),"currentCol",source)
                setElementData(getLocalPlayer(),"loot",false)
                setNewbieInfo (true,"Usu? P?ot","Nacisnij '-' lub 'scroll myszki' aby usun?? P?ot!\nMusisz mie?:Narz?dzia",source)
                return
            end
            if getElementData(source,"ammobox") then
                showClientMenuItem("Ammobox","ammobox")
                setElementData(getLocalPlayer(),"currentCol",source)
                setElementData(getLocalPlayer(),"loot",true)
                setElementData(getLocalPlayer(),"lootname","Przeszukaj pude?ko z amunicj?")
                setNewbieInfo (true,"&#1055;&#1086;&#1089;&#1084;&#1086;&#1090;&#1088;&#1077;&#1090;&#1100;","Nacisnij '-' lub 'scroll myszki aby przeszuka? pude?ko z amunicj?!",source)
                return
            end
        if getElementData(source,"trader") then
            setElementData(getLocalPlayer(),"near_trader",true)
            setElementData(getLocalPlayer(),"near_trader_shape",source )
            showTraderWindow()
            --setNewbieInfo (true,"&#1055;&#1088;&#1086;&#1076;&#1072;&#1074;&#1077;&#1094;","&#1053;&#1072;&#1078;&#1084;&#1080;&#1090;&#1077; '"..trade_open_button.."' &#1076;&#1083;&#1103; &#1090;&#1086;&#1088;&#1075;&#1086;&#1074;&#1083;&#1080;!",source)
            return
        end
            if getElementData(source,"safe") then
                showClientMenuItem("safe")
                setElementData(getLocalPlayer(),"currentCol",source)
                setElementData(getLocalPlayer(),"loot",true)
                --setElementData(getLocalPlayer(),"loot",false)
                return
            end
        if getElementData(source,"fireplace") then
            showClientMenuItem("Fireplace")
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",false)
            setNewbieInfo (true,"Fireplace","Nacisnij '-' lub 'scroll myszki' aby ugotowa? mi?so!\n Musisz mie?: Surowe Mi?so",source)
            isInFirePlace = true
            setElementData(getLocalPlayer(),"isInFirePlace",true)
            return
        end
        if getElementData(source,"deadman") then
            showClientMenuItem("Dead",getElementData(source,"playername"))
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",true)
            setElementData(getLocalPlayer(),"lootname","Przeszukanie ("..getElementData(source,"playername")..")")
            setNewbieInfo (true,"Przeszukaj","Nacisnij 'J' aby przeszuka? cia?o!",source)
            return
        end
        if getElementData(source,"item") then
            showClientMenuItem("Rzecz",getElementData(source,"item"))
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",false)
            return            setNewbieInfo (true,"Przeszukaj","Nacisnij '-' lub 'scroll myszki' aby podnie?c ten item!",source)

        end
        if getElementData(source,"helicrash") then
            showClientMenuItem("Helicrashsite","helicrash")
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",true)
            setElementData(getLocalPlayer(),"lootname","Sprawd?") --(Helicrash)
            setNewbieInfo (true,"Sprawd?","Nacisnij 'J' aby sprawdzi? Sprawd?osa?enie!",source)
            return
        end
        if getElementData(source,"hospitalbox") then
            showClientMenuItem("Hospitalbox","hospitalbox")
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",true)
            setElementData(getLocalPlayer(),"lootname","Sprawd? (Hospitalbox)")
            setNewbieInfo (true,"Przeszukaj","Nacisnij 'J' aby sprawdzi? skrzynie!",source)
            return
        end
        if getElementData(source,"vehicle") then
            if not getElementData(source,"deadVehicle") then
            showClientMenuItem("Vehicle",(getVehicleName(getElementData(source,"parent")) or "Namiot"),getElementData(source,"parent"),source)
            setElementData(getLocalPlayer(),"currentCol",source)
            setElementData(getLocalPlayer(),"loot",true)
            setElementData(getLocalPlayer(),"lootname","Wyposa?enie")
            setNewbieInfo (true,"Przeszukaj","Nacisnij 'J' aby przeszuka?!",source)
            return
            end
        end
        if getElementData(source,"itemloot") then
            showClientMenuItem("Przeszukaj")
            setElementData(getLocalPlayer(),"loot",true)
            setElementData(getLocalPlayer(),"lootname","Przeszukaj")
            setElementData(getLocalPlayer(),"currentCol",source)
            setNewbieInfo (true,"Przeszukaj","Nacisnij 'J' aby sprawdzi? co tutaj le?y!",source)
            return
        end
    showClientMenuItem("stop")
end    
end
addEventHandler("onClientColShapeHit",getRootElement(),onPlayerTargetPickup)

function onPlayerTargetPickup (theElement)
if theElement == getLocalPlayer() then
    local players = getElementsWithinColShape ( source, "player" )
    if players == getLocalPlayer() then --[[return ]]end
    showClientMenuItem("stop")
    setElementData(getLocalPlayer(),"loot",false)
    setElementData(getLocalPlayer(),"currentCol",false)
    setNewbieInfo (false,"","")
    isInFirePlace = false
    setElementData(getLocalPlayer(),"isInFirePlace",false)
end
end
addEventHandler("onClientColShapeLeave",getRootElement(),onPlayerTargetPickup)

--Newbie Infos
local screenWidth, screenHeight = guiGetScreenSize()
local newbieShow = false
local newbieHead = "-"
local newbieText = "-"
local newbiePosition = 0,0,0

function setNewbieInfo (show,head,text,element)
newbieShow = show
newbieHead = head
newbieText = text
newbiePosition = element
end

addEventHandler("onClientRender", getRootElement(), 
function()

    local veh = getPedOccupiedVehicle (getLocalPlayer())
    if veh then
        disableMenu()
    else
        for id, value in pairs(theTableMenuScroll) do
            if id == numberMenuScroll then
                r1menu,g1menu,b1menu = 100,255,100
            else
                r1menu,g1menu,b1menu = 255,255,255
            end
            --dxDrawRectangle ( 0, 250+id*boxSpace, screenWidth*0.2, boxSpace, tocolor (r1menu,g1menu,b1menu,180) )
            dxDrawingColorTextMenuScroll(value[1],30, 120+id*boxSpace, 7, 250+(id+1)*boxSpace, tocolor(r1menu,g1menu,b1menu,170),170, 1, "sans", "center", "center")
        end
    end

    if newbieShow == false then return end
    local x,y,z = getElementPosition(newbiePosition)
    local x,y = getScreenFromWorldPosition (x,y,z)
    local length = dxGetTextWidth(newbieText,1,"default-bold")
    dxDrawImage ( x-length/2-screenWidth*0.01,y,screenWidth*0.06, screenHeight*0.05, "images/Loot_1.png",0,0,0,tocolor(255,255,255))
    --dxDrawingColorText(newbieHead,x-length/2-screenWidth*0.01,y, x+length/2+screenWidth*0.01, y+screenHeight*0.03, tocolor(22,255,22,120),0.5, 1.1, "default-bold", "center", "center")
    --dxDrawingColorText(newbieText,x-length/2-screenWidth*0.01,y+screenHeight*0.03, x+length/2+screenWidth*0.01, y+screenHeight*0.07, tocolor(22,255,22,120),0.5, 1, "default-bold", "center", "center")
end
)

function fireRaiseTemperature ()
    if isInFirePlace then
        if getElementData(getLocalPlayer(),"temperature") <= 38 then
            setElementData(getLocalPlayer(),"temperature",getElementData(getLocalPlayer(),"temperature")+0.25)
        end
    end
end
setTimer(fireRaiseTemperature,10000,0)

------------------------------------------------------------------------------

unbindKey("mouse3","both")
function onPlayerPressMiddleMouse (key,keyState)
if ( keyState == "down" ) then
        if not getElementData(localPlayer,"usedItemTrue") then return end
        local itemName = getMenuMarkedItem()
        if itemName == "helicrashsite" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Sprawd? (Helicrash)" -- Helicrash
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "itemloot" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Przeszukaj"
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "wirefence" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Remove Wirefence"
            triggerServerEvent("removeWirefence",getLocalPlayer(),getElementData(col,"parent"))
            disableMenu()
            return
        end
        if itemName == "sandbags" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Remove SandBags"
            triggerServerEvent("removeSandBags",getLocalPlayer(),getElementData(col,"parent"))
            disableMenu()
            return
        end
        if itemName == "hospitalbox" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Sprawd? (Hospitalbox)"
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "ammobox" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Sprawd? (Ammobox)"
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "removesafe" then
            --askDestroyPassWindow()
            if ( getElementData ( localPlayer, "Narz?dzia") or 0 ) > 0 then
                if getPlayerCurrentSlots() + getItemSlots("Sejf") <= getPlayerMaxAviableSlots() then
                    triggerServerEvent("onPlayerDestroySafePlace",getLocalPlayer())    
                else
                    triggerEvent ("displayClientInfo", getLocalPlayer(),"Inventory","Nie masz wystarczaj?co du?o miejsca",22,255,0)
                end
            else
                triggerEvent ("displayClientInfo", getLocalPlayer(),"Inventory","Nie posiadasz narz?dzi!",22,255,0)
            end
            return
        end
        if itemName == "opensafe" then
            askedPasswordWindowSafe()
            return
        end
        if itemName == "hidebody" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
            triggerServerEvent ( "hideBodyClient", localPlayer )
            --showClientMenuItem("stop")
            disableMenu()
            setNewbieInfo (false,"","")
        else
    outputChatBox ( "Do chowania cia?a potrzebne s? narz?dzia!", 255, 0, 0 )
        end
    return
end
        if itemName == "vehicle" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Sprawd? ("..(getVehicleName(getElementData(col,"parent")) or "Namiot")..")"
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "repairvehicle" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent"))
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end    
            disableMenu()
            return
        end
    
        if itemName == "FuelOne" then
            if (getElementData(getLocalPlayer(),"Pe?ny Kanister") or 0) >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                if getElementData(col,"fuel")+20 < getVehicleMaxFuel(col) then
                    addingfuel = 20
                elseif getElementData(col,"fuel")+20 > getVehicleMaxFuel(col)+15 then
                    triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Zbiornik pe?ny!",255,22,0)
                    disableMenu()
                    return
                else
                    addingfuel = getVehicleMaxFuel(col)-getElementData(col,"fuel")
                end
                if (getElementData(col,"Czesci_inVehicle") or 0) < 1 then
                    addingfuel = addingfuel/3
                    triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Zatankowa?e? Pojazd!",22,255,0)
                end
                setElementData(getLocalPlayer(),"Pe?ny Kanister",getElementData(getLocalPlayer(),"Pe?ny Kanister")-1)
                setElementData(getLocalPlayer(),"Pusty Kanister",(getElementData(getLocalPlayer(),"Pusty Kanister") or 0)+1)
                setElementData(col,"fuel",getElementData(col,"fuel")+addingfuel)
                --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Rozla?e? Paliwo! Zatankowa?e? "..addingfuel.." litr?w!",22,255,0)
            else
                startRollMessage2("Inventory", "Nie masz pe?nego kanistra!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        if itemName == "FuelTwo" then
            if (getElementData(getLocalPlayer(),"Pusty Kanister") or 0) >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                setElementData(getLocalPlayer(),"Pe?ny Kanister",getElementData(getLocalPlayer(),"Pe?ny Kanister")+1)
                setElementData(getLocalPlayer(),"Pusty Kanister",(getElementData(getLocalPlayer(),"Pusty Kanister") or 0)-1)
                --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                setElementData(col,"fuel",getElementData(col,"fuel")-20)
                triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Spu?cile? 20litr?w!",22,255,0)
            else
                startRollMessage2("Inventory", "Nie masz pustego kanistra!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
        if itemName == "TireOne" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                if (getElementData(getLocalPlayer(),"Ko?a") or 0) > 0 then    
                    local col = getElementData(getLocalPlayer(),"currentCol")
                    setElementData(col,"Ko?a_inVehicle",(getElementData(col,"Ko?a_inVehicle") or 0)+1)
                    setElementData(getLocalPlayer(),"Ko?a",(getElementData(getLocalPlayer(),"Ko?a") or 0)-1)
                    --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                    startRollMessage2("Inventory", "Za?o?y?e? Ko?o!", 22, 255, 0 )
                else
                    startRollMessage2("Inventory", "Nie masz k??!", 255, 22, 0 )
                end
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
        if itemName == "TireTwo" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                if (getElementData(col,"Ko?a_inVehicle") or 0) > 0 then    
                    local col = getElementData(getLocalPlayer(),"currentCol")
                    setElementData(col,"Ko?a_inVehicle",(getElementData(col,"Ko?a_inVehicle") or 0)-1)
                    setElementData(getLocalPlayer(),"Ko?a",(getElementData(getLocalPlayer(),"Ko?a") or 0)+1)
                    --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                    startRollMessage2("Inventory", "Zdemontowa?e? ko?o!", 22, 255, 0 )
                else
                    startRollMessage2("Inventory", "W poje?dzie nie ma k??ek!", 255, 22, 0 )
                end
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
        if itemName == "EngineOne" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                if (getElementData(getLocalPlayer(),"Silnik") or 0) > 0 then    
                    local col = getElementData(getLocalPlayer(),"currentCol")
                    setElementData(col,"Silnik_inVehicle",(getElementData(col,"Silnik_inVehicle") or 0)+1)
                    setElementData(getLocalPlayer(),"Silnik",(getElementData(getLocalPlayer(),"Silnik") or 0)-1)
                    ---triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                    startRollMessage2("Inventory", "Za?o?y?e? silnik!", 22, 255, 0 )
                else
                    startRollMessage2("Inventory", "Nie masz silnika!", 255, 22, 0 )
                end
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
        
        if itemName == "EngineTwo" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                if (getElementData(col,"Silnik_inVehicle") or 0) > 0 then    
                    local col = getElementData(getLocalPlayer(),"currentCol")
                    setElementData(col,"Silnik_inVehicle",(getElementData(col,"Silnik_inVehicle") or 0)-1)
                    setElementData(getLocalPlayer(),"Silnik",(getElementData(getLocalPlayer(),"Silnik") or 0)+1)
                    --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                    startRollMessage2("Inventory", "Wyci?g?e? silnik!", 22, 255, 0 )
                else
                    startRollMessage2("Inventory", "W poje?dzie nie ma silnika!", 255, 22, 0 )
                end
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
--    if itemName == "PartsOne" then
--        if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
--            if (getElementData(getLocalPlayer(),"Czesci") or 0) > 0 then    
--                local col = getElementData(getLocalPlayer(),"currentCol")
--                setElementData(col,"Czesci_inVehicle",(getElementData(col,"Czesci_inVehicle") or 0)+1)
--                setElementData(getLocalPlayer(),"Czesci",(getElementData(getLocalPlayer(),"Czesci") or 0)-1)
--                ---triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
--                startRollMessage2("Inventory", "Za?o?y?e? Czesci!", 22, 255, 0 )
--            else
--                startRollMessage2("Inventory", "Nie masz Czesci!", 255, 22, 0 ) 
--            end
--        else
--            startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
--        end
--        disableMenu()
--        return
--    end
        
        if itemName == "PartsTwo" then
            if getElementData(getLocalPlayer(),"Narz?dzia") >= 1 then
                local col = getElementData(getLocalPlayer(),"currentCol")
                if (getElementData(col,"Czesci_inVehicle") or 0) > 0 then    
                    local col = getElementData(getLocalPlayer(),"currentCol")
                    setElementData(col,"Czesci_inVehicle",0)
                    setElementData(getLocalPlayer(),"Czesci",(getElementData(getLocalPlayer(),"Czesci") or 0)+1)
                    --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer())
                    startRollMessage2("Inventory", "Usun??e? Czesci Samochodowe!", 22, 255, 0 )
                else
                    startRollMessage2("Inventory", "W poje?dzie nie ma Czesci!", 255, 22, 0 )
                end
            else
                startRollMessage2("Inventory", "Nie posiadasz narz?dzi!", 255, 22, 0 )
            end
            disableMenu()
            return
        end
        
        if itemName == "tent" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            triggerServerEvent("removeTent",getLocalPlayer(),getElementData(col,"parent"))
            disableMenu()
            return
        end
        if itemName == "fireplace" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            triggerServerEvent("addPlayerCookMeat",getLocalPlayer())
            disableMenu()
            return
        end
        if itemName == "Banda?" then
            local col = getElementData(getLocalPlayer(),"currentCol")
                triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent"))
                disableMenu()
            return
        end
        if itemName == "giveblood" then
            local col = getElementData(getLocalPlayer(),"currentCol")
                triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent"))
                disableMenu()
            return
        end
        if itemName == "dead" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            local gearName = "Przeszukaj ("..getElementData(col,"playername")..")"
            refreshLoot(col,gearName)
            showInventoryManual()
            return
        end
        if itemName == "deadreason" then
            local col = getElementData(getLocalPlayer(),"currentCol")
            outputChatBox(getElementData(col,"deadreason"),255,255,255,true)
            return
        end
        if itemName == "patrolstation" then
            local col = getElementData(getLocalPlayer(),"currentCol")
                setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant",nil,false,false,nil,false)
                setElementData(getLocalPlayer(),"Pusty Kanister",getElementData(getLocalPlayer(),"Pusty Kanister")-1)
                setElementData(getLocalPlayer(),"Pe?ny Kanister",(getElementData(getLocalPlayer(),"Pe?ny Kanister") or 0)+1)
                triggerEvent ("displayClientInfo",getLocalPlayer(),"patrolstation","Kanister jest pe?ny!",22,255,0)
                disableMenu()
            return
        end

            if isToolbeltItem(itemName) then 
           local col = getElementData(getLocalPlayer(), "currentCol") 
           if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then        
                return        
             end 
            x, y, z = getElementPosition(getLocalPlayer()) 
            if pcount ~= nil and pcount < getTickCount() then 
                 pcount = getTickCount() + math.random(1800,2200)        
                 x, y, z = getElementPosition(getLocalPlayer()) 
                 return false 
               elseif pcount == nil then 
                 pcount = getTickCount() + math.random(1800,2200) 
                 x, y, z = getElementPosition(getLocalPlayer()) 
                 return false 
               end 
              local x1, y1, z1 = getElementPosition(getLocalPlayer()) 
               if x1 ~= x or y1 ~= y or z1 ~= z then 
                 pcount = nil 
              return false 
             end 
             pcount = nil 
             triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col) 
            disableMenu() 
            return 
          end        
          local col = getElementData(getLocalPlayer(),"currentCol") 
          triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) 
          disableMenu() 
          return 
         end        
         if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then 
               local col = getElementData(getLocalPlayer(), "currentCol") 
               if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then        
                 return        
               end 
               x, y, z = getElementPosition(getLocalPlayer()) 
               if pcount ~= nil and pcount < getTickCount() then 
                 pcount = getTickCount() + math.random(1800,2200) 
                 x, y, z = getElementPosition(getLocalPlayer()) 
                 return false 
               elseif pcount == nil then 
                 pcount = getTickCount() + math.random(1800,2200) 
                 x, y, z = getElementPosition(getLocalPlayer()) 
                 return false 
               end 
               local x1, y1, z1 = getElementPosition(getLocalPlayer()) 
               if x1 ~= x or y1 ~= y or z1 ~= z then 
                 pcount = nil 
                 return false 
               end 
               pcount = nil 
               triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col) 
               disableMenu() 
            else 
             startRollMessage2("Inventory", "Ekwipunek Pe?ny!", 255, 22, 0) 
           end 
         end 
bindKey ( "mouse3", "down", onPlayerPressMiddleMouse ) 
bindKey ( "-", "down", onPlayerPressMiddleMouse ) 

function getMenuMarkedItem()        
        for i,guiItem in ipairs(spalteGuiText) do 
         if getElementData(guiItem,"markedMenuItem") then 
          return getElementData(guiItem,"usedItem")        
         end 
        end 
end 

function playerPressedKey(button, press) 
           if (press) then 
         if button == "w" or button == "a" or button == "s" or button == "d" then 
          local anim,anim2 = getPedAnimation (getLocalPlayer()) 
          if anim and anim == "SCRATCHING" and anim2 == "sclng_r" then 
           triggerServerEvent("onClientMovesWhileAnimation",getLocalPlayer()) 
          end        
         end 
           end 
end

function getMenuMarkedItem() 
    for id, value in pairs(theTableMenuScroll) do
        if id == numberMenuScroll then
            return value[5]
        end
    end
end


Komentarz Allansso dodany 2018-09-16, 18:42Następnym razem dawaj w [lua] :)
Ostatnio zmieniony przez Allansso 2018-09-16, 18:42, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 18:43


Allansso







Wiek: 25
Na forum: 4079 dni
Posty: 386

Piwa: 1546

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 100%
Wystepuj? jakie? b??dy? (debugscript 3 w konsoli)

Podpis
https://www.youtube.com/TheMikol
https://www.facebook.com/TheMikol1337
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
rzepa0
Wysłany: 2018-09-16, 20:25


rzepa0







Wiek: 28
Na forum: 2980 dni
Posty: 3

Piwa: 1

Respekt: 50

Poradzi?em sobie sam, dzi?ki wielkie za zainteresowanie z twojej strony!

Postaw piwo autorowi tego posta
 

 
Tagi: mta :: dayz
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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