Lukkas2201

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Lukkas2201

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Lukkas2201

    Erro com Col

    pra depurar é so meter um outputDebugString com varias mensagens pra eu saber qual o erro atraves da mensagem que eu coloquei no debugstring ne? vou fazer isso
  2. Lukkas2201

    Erro com Col

    então mano, praticamente oque falta é so esse bug, o resto consegui resolver a maioria, essa gm adiquiri ano passado, e ja corrigi MUITOS bugs nela, sei onde tem a maioria das funcoes, porem esse bug surgiu recentemente, por iso ainda nao consegui saber oque é, pra mim nao compensa refazer desde o 0, tem MUITA coisa na minha Gm ja, mas o bug q mais atrapalha e oq falta so praticamente é esse :/
  3. Lukkas2201

    Erro com Col

    Seguinte, a um tempo atras estava com um problema, que eu pensei que fosse do Inventario do MTA DayZ, porém acabei descobrindo que não é, eu troquei o inventário todo, e o bug continuou, percebi que podia ser no script menu_client do mta dayz, porém eu to comparando ele com varios outros menu_client que tenho, e nao tem nada de errado. o erro é o seguinte, o player ta jogando de boa, ai ele vai lotear a tenda dele, e ele clica pra pegar o item, e não vai, o item fica la na tenda, mas simplesmente vc clica pra pegar e nao acontece nada, ai tem que ficar saindo e voltando pra tenda até desbugar, e quando ele consegue acessar, e começa a passar itens pra tenda, no caso seria ao contrario, ao invez de pegar, ele vai guardar, ai dps de um tempo os itens começam ir pro chão, como se ele tivesse saido da tenda, mas na verdade não saiu, e os itens na tenda continuam mostrando no inventario, só que em vez de ir pra tenda, vai pro chão ,creio eu que seja no menu_client, porém ta foda de conseguir saber qual função que seja, alguém poderia me ajudar? (obs: não é só com tenda, com gear de hospitalbox,, gear de corpo de player que no caso é o dead, tbm acontece) ------------S1L3NC3 local theTableMenuScroll = {} function startRollMessageMenu(text, r, g, b, data) table.insert(theTableMenuScroll,{text,r,g,b,data}) 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 Bandage"}, {"Give Painkiller"}, {"Give Morphine"}, }, } function showClientMenuItem(arg1,arg2,arg3,arg4) theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) numberMenuScroll = 1 if getElementData(localPlayer,"playerZombie") then return end if arg1 == "Take" then startRollMessageMenu("Gear: "..arg2,0,255,0,arg2) setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then startRollMessageMenu("Gear",255,255,255,"helicrashsite") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "AIRDROP" then startRollMessageMenu("Gear",255,255,255,"AIRDROP") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Hospitalbox" then startRollMessageMenu("Gear",255,255,255,"hospitalbox") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Vehicle" then startRollMessageMenu("> Gear ("..arg2.."): "..getLootCurrentSlots(arg4).."/"..(getElementData(arg4,"MAX_Slots") or 0).." Slots",0,255,0,"vehicle") setElementData(localPlayer,"usedItemTrue", true) if getElementData(getElementData(arg3,"parent"),"tent") then startRollMessageMenu("#FFFFFF> Remover Tent",0,255,0,"tent") return end if getElementHealth(arg3,"repairvehicle") < 1000 and getElementHealth(arg3) >= 50 then startRollMessageMenu("> Reparar ("..arg2.."): " ..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("> Colocar Gasolina ("..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("> Remover Gasolina ("..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,"Tire_inVehicle") or 0) < tires then startRollMessageMenu("> Colocar Tire ("..(getElementData(arg4,"Tire_inVehicle") or 0).."/"..tires..")",255,0,0,"TireOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Engine_inVehicle") or 0) < engine then startRollMessageMenu("> Colocar Engine ("..(getElementData(arg4,"Engine_inVehicle") or 0).."/"..engine..")",255,0,0,"EngineOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) < parts then startRollMessageMenu("> Colocar Tank Parts ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",255,0,0,"PartsOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"armorPoints") or 0) < (getElementData(arg4,"armorPointsMax") or 0) then if (getElementData(localPlayer,"Steel Sheet") or 0) >= 0 then startRollMessageMenu("> Colocar Steel Sheet",255,0,0,"setListStale") setElementData(localPlayer,"usedItemTrue", true) end end if (getElementData(arg4,"receiver") or 0) < 1 then if getElementData(getLocalPlayer(),"Radio Device") >= 0 then startRollMessageMenu("> Colocar Radio Device",255,0,0,"receiver") setElementData(localPlayer,"usedItemTrue", true) end end if (getElementData(arg4,"Tire_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Tire ("..(getElementData(arg4,"Tire_inVehicle") or 0).."/"..tires..")",255,255,0,"TireTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Engine_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Engine ("..(getElementData(arg4,"Engine_inVehicle") or 0).."/"..engine..")",255,255,0,"EngineTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Tank Parts ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",255,255,0,"PartsTwo") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Player" then if getElementData(arg2,"bleeding") > 0 and getElementData(getLocalPlayer(),"Bandage") >= 1 then startRollMessageMenu("Give Bandage",255,255,255,"bandage") setElementData(localPlayer,"usedItemTrue", true) end if getElementData(arg2,"blood") < 11900 and getElementData(getLocalPlayer(),"Blood Bag") >= 1 then startRollMessageMenu("Administer Blood Bag",255,255,255,"giveblood") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Dead" then startRollMessageMenu("> Gear ("..arg2..")",0,255,0,"dead") startRollMessageMenu("#FFFFFF> Check Body",0,255,0,"deadreason") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"#FFFFFF> Raw Meat") >= 1 then startRollMessageMenu("Cook Meat",255,255,255,"fireplace") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "patrol" then if getElementData(getLocalPlayer(),"Empty Gas Canister") >= 1 then startRollMessageMenu("#FFFFFF> Encher (Empty Gas Canister)",255,255,255,"patrolstation") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Wirefence" then startRollMessageMenu("Remove Wire Fence",255,255,255,"wirefence") setElementData(localPlayer, "usedItemTrue", "wirefence") end if arg1 == "Stinger" then startRollMessageMenu("Remove Stinger",255,255,255,"removestinger") setElementData(localPlayer,"usedItemTrue","removestinger") end if arg1 == "Gear" then startRollMessageMenu("> Gear",255,255,255,"itemloot") setElementData(localPlayer,"usedItemTrue", true) end numberMenuScroll = 1 end 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 refreshMenuCar() idd = numberMenuScroll theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) setNewbieInfo (false,"","") showClientMenuItem("Vehicle",nil,getElementData(getElementData(localPlayer,"currentCol"),"parent"),getElementData(localPlayer,"currentCol")) numberMenuScroll = idd end addEvent("refreshMenuCar",true) addEventHandler("refreshMenuCar",getLocalPlayer(),refreshMenuCar) 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 getElementData(getLocalPlayer(),"isDead",true) then return end 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,"tent") then if getElementData(source,"visible") == false then setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) return end end if getElementData(source,"patrolstation") then showClientMenuItem("patrol") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Gear","Need: Empty Gas Canister",source) return end if getElementData(source,"wirefence") then showClientMenuItem("Wirefence") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true, "Wirefence","Press '-' or 'middle-mouse' to remove the fence!\nRequired: Toolbox", source) return end if getElementData(source,"stinger") then showClientMenuItem("Stinger") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true, "Stinger","Press '-' or 'middle-mouse' to remove the Stinger!\nRequired: Toolbox", source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fireplace") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Fireplace","Need: Raw Meat",source) 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","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Gear","To Choose The Subject!\n"..getElementData(source,"item"),source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrashsite","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"vehicle") and not getElementData(source,"deadVehicle") then if not getElementData(source,"tent") then name = getVehicleName(getElementData(source,"parent")) else name = "Tent" end showClientMenuItem("Vehicle",name,getElementData(source,"parent"),source) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..name..")") setNewbieInfo(true, "Gear", "Pressione J para abrir!", source) return end if getElementData(source,"itemloot") then showClientMenuItem("Gear") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end showClientMenuItem("stop") end end addEventHandler("onClientColShapeHit",getRootElement(),onPlayerTargetPickup) function onPlayerTargetPickup (theElement) if theElement == getLocalPlayer() then showClientMenuItem("stop") setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) setElementData(getLocalPlayer(),"near_trader",false) setElementData(getLocalPlayer(),"near_trader_shape",nil ) setNewbieInfo (false,"","") isInFirePlace = false setElementData(getLocalPlayer(),"isInFirePlace",false) if getElementData(source,"smeltery") then setElementData(getLocalPlayer(),"smeltery",false) end end end addEventHandler("onClientColShapeLeave",getRootElement(),onPlayerTargetPickup) 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 = 25,153,25 else r1menu,g1menu,b1menu = 19,19,19 end dxDrawRectangle ( 0, 250+id*boxSpace, screenWidth*0.2, boxSpace, tocolor (r1menu,g1menu,b1menu,180) ) dxDrawingColorTextMenuScroll(value[1],6, 250+id*boxSpace, 6, 250+(id+1)*boxSpace, tocolor(value[2],value[3],value[4],170),170, 1, "default-bold", "center", "center") end end if getElementData(getLocalPlayer(),"isDead") == true then return 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") if not x then return end local xx,yy,xx2,yy2 = x-length/2, y-70/2, length+22, 70 if newbieHead == "Item pickup" then dxDrawImage(x-length/2-screenWidth*0.01,y,screenWidth*0.02+length,screenHeight*0.1,"images/Loot1.png",0,0,0,tocolor(255,255,255)) else dxDrawImage(x-length/2-screenWidth*0.01,y,screenWidth*0.02+length,screenHeight*0.1,"images/Loot2.png",0,0,0,tocolor(255,255,255)) end 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 = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "itemloot" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "wirefence" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Remove Wirefence" triggerServerEvent("removeWirefence",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "removestinger" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Remove Stinger" triggerServerEvent("RemoveStingerServer",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "hospitalbox" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "vehicle" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "repairvehicle" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Scrap Metal") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) setElementData(getLocalPlayer(),"Scrap Metal",(getElementData(getLocalPlayer(),"Scrap Metal") or 0)-1) -- startRollMessage2("Inventory", "Você reparou o o veículo!", 22, 255, 0 ) --setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Scrap Metal!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "object" then showInventory("j","down") return end if itemName == "receiver" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Radio Device") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"receiver",1) setElementData(getLocalPlayer(),"Radio Device",(getElementData(getLocalPlayer(),"Radio Device") or 0)-1) startRollMessage2("Inventory", "Você colocou Rádio Device no Veículo!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Radio Device!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelOne" then if (getElementData(getLocalPlayer(),"Full Gas Canister") 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","Tanque Cheio!",255,22,0) disableMenu() return else addingfuel = getVehicleMaxFuel(col)-getElementData(col,"fuel") end if (getElementData(col,"Parts_inVehicle") or 0) < 1 then addingfuel = addingfuel/3 triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Resultante do transporte de gasolina!",22,255,0) end setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")-1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)+1) setElementData(col,"fuel",getElementData(col,"fuel")+addingfuel) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Você encheu "..addingfuel.." L!",22,255,0) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Refuel.mp3") else startRollMessage2("Inventory", "Você não tem Full Gas Canister!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelTwo" then if (getElementData(getLocalPlayer(),"Empty Gas Canister") or 0) >= 1 then if (getElementData(getLocalPlayer(),"Hose") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")+1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) setElementData(col,"fuel",getElementData(col,"fuel")-20) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Você retirou 20L do Veículo!",22,255,0) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Refuel.mp3") else startRollMessage2("Inventory", "Você não tem Hose!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Empty Gas Canister!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tire") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Tire_inVehicle",(getElementData(col,"Tire_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocou um Tire!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tire!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Tire_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Tire_inVehicle",(getElementData(col,"Tire_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Tire!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tire!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Engine") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Engine_inVehicle",(getElementData(col,"Engine_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Engine",(getElementData(getLocalPlayer(),"Engine") or 0)-1) ---triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocu um Engine!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Engine!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end --- steel sheet if itemName == "setListStale" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Steel Sheet") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"armorPoints",getElementData(col,"armorPoints") + 100) setElementData(getLocalPlayer(),"Steel Sheet",(getElementData(getLocalPlayer(),"Steel Sheet") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você adicionou Steel Sheet!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Steel Sheet!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Engine_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Engine_inVehicle",(getElementData(col,"Engine_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Engine",(getElementData(getLocalPlayer(),"Engine") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Engine!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Engine!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tank Parts") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tank Parts",(getElementData(getLocalPlayer(),"Tank Parts") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocou um Tank Parts!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tank Parts!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Parts_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Tank Parts",(getElementData(getLocalPlayer(),"Tank Parts") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Tank Parts!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tank Parts!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "tent" then local screenW, screenH = guiGetScreenSize() showCursor(true) disableMenu() tentGuiConfirm = guiCreateWindow((screenW - 254) / 2, (screenH - 147) / 2, 254, 147, "Tent", false) guiWindowSetMovable(tentGuiConfirm, false) guiWindowSetSizable(tentGuiConfirm, false) tentLabelConfirm = guiCreateLabel(23, 34, 207, 15, "Deseja realmente remover a tenda?", false, tentGuiConfirm) guiSetFont(tentLabelConfirm, "default-bold-small") tentYesConfirm = guiCreateButton(23, 64, 81, 51, "Remover", false, tentGuiConfirm) tentCancelConfirm = guiCreateButton(149, 64, 81, 51, "Cancelar", false, tentGuiConfirm) addEventHandler("onClientGUIClick",tentYesConfirm, function () local col = getElementData(getLocalPlayer(),"currentCol") showCursor(false) guiSetVisible(tentGuiConfirm, false) triggerServerEvent("removeTent",getLocalPlayer(),getElementData(col,"parent")) setSoundMaxDistance(playSound3D("sounds/DesmontarTenda.mp3",x,y,z),15) end, false) addEventHandler("onClientGUIClick",tentCancelConfirm, function () showCursor(false) guiSetVisible(tentGuiConfirm, false) end, false) return end if itemName == "fireplace" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("addPlayerCookMeat",getLocalPlayer()) disableMenu() return end if itemName == "bandage" 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 = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "deadreason" then local col = getElementData(getLocalPlayer(),"currentCol") outputChatBox(getElementData(col,"deadreason"),244,244,244,true) return end if itemName == "patrolstation" then local col = getElementData(getLocalPlayer(),"currentCol") setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) setElementData(getLocalPlayer(),"Empty Gas Canister",getElementData(getLocalPlayer(),"Empty Gas Canister")-1) setTimer ( function() setElementData(getLocalPlayer(),"Full Gas Canister",(getElementData(getLocalPlayer(),"Full Gas Canister") or 0)+1) triggerEvent ("displayClientInfo",getLocalPlayer(),"patrolstation","Você encheu um Empty Gas Canister!",0,255,0) end, 5000, 1 ) playSound("sounds/Refill.mp3") disableMenu() return end if isToolbeltItem(itemName) then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() return end if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() else startRollMessage2("Inventory", "Inventory Full!", 255, 0, 0 ) end 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 getMenuMarkedItem() for id, value in pairs(theTableMenuScroll) do if id == numberMenuScroll then return value[5] end end end
  4. Lukkas2201

    Erro com arma

    sim, é arma duplicada, porém tem varias armas duplicadas, como assault rifles, snipers, e so buga com shotguns
  5. Lukkas2201

    Erro com arma

    sim já, eu pensei que fosse na função OnPlayerWeaponFire, porém lá ta tudo certo.
  6. Lukkas2201

    Erro com arma

    boa tarde, seguinte, estou com um problema e não consigo saber oque é, meu servidor de dayz, quando equipo a shotgun, ou sniper (não é toda vez que acontece), mesmo estando com arma e munição, ela não atira, aparece a arma, a munição, ai quando clica pra atirar não acontece nada, ai tem que relogar do servidor, alguem sabe me dizer oque pode ser?
  7. Lukkas2201

    Spawn de Veiculo

    consegui mano, era isso mesmo, obrigadão, e lhe agradeço também pela paciencia que teve comigo kkk, obrigadão !!
  8. Lukkas2201

    Spawn de Veiculo

    pior que nao, se eu removo essa linha, ai que os veiculos ficam realmente 0/0, porem creio que com esta linha esteja errado, porque ela consegue fazer com que alguns veiculos respawnem normalmente com os slots corretos, porem outros continuam respawnando com 0/0
  9. Lukkas2201

    Spawn de Veiculo

    corrigindo **, verdade, confundi com outra coisa, eu juro que ja tinha visto essa table em algum outro lugar, a propria table lembro que tinha visto nao lembro onde, agora fui dar uma pesquisada e realmente nao tem, eu fiquei tipo "ue ???" , mas ela interfere em algo? ou nao muda nada ela estar ali sem existir?
  10. Lukkas2201

    Spawn de Veiculo

    as datas estavam alteradas, fui testando uma por uma e consegui, deu certo cara, obrigado de verdade!!! aproveitando pra nao precisar criar outro tópico, se puder me ajudar tbm, o seguinte, quando spawno os veiculos pela primeira vez pelo svp, ele spawna certingo, dependendo de cada veiculo, com os slots 0/50, entre outros, (o valor 50 varia de cada veículo) e ao respawnar quando explode, ao invez de setar 0/50 novamente, ele spawna 0/0, tentei adicionar um data[5] na linha 34, pois creio que seja nessa data[5] que venha o slots, porém não deu certo, teria como me ajudar também? se possível
  11. Lukkas2201

    Spawn de Veiculo

    boa tarde Bruno, então cara, pra vc isso é facil, mas como eu disse eu sou iniciante, porém em NENHUM momento eu pedi script pronto, eu só perguntei oque eu teria que fazer, eu posto um script e vc me diz que o erro esta nas posicoes, disso eu ja sei, vc que nao leu meu tópico, pois ali mesmo ja da pra saber que o erro esta na posicao, eu so queria instrucao sobre o que eu tenho que fazer no caso, e eu queria pedir um pouco menos de ignorancia, tu ja foi iniciante alguma vez, porém vc deve ter tido mais ajuda do que eu, ou se aprendeu na marra meus parabéns, porém pra mim é difícil, lhe peço compreensão, agora dizer que eu pedi script pronto é mentira, apenas pergunto oque eu tenho que fazer.. enfim, esse codigo que vc me mandou, vc mandou ele pronto, ou tenho que alterar algo? pois se vc mandou ele pronto, não funcionou, ele acusa esse warning, e na hora que o veiculo explode, ao invez de respawnar, da um error no vehicle spawns. https://ibb.co/gWBh9XR https://ibb.co/M101h1J porém eu vou aguardar a resposta pra saber se vc mandou o codigo pronto, ou se tenho que trocar alguma coisa nele. pois é, eu sou iniciante, ainda mais MTA DayZ, é muito complicado, creio que seja mais complicado ainda do que servidores de Roleplay, freeroam, entre outros, e não tem nenhum outro método que posso receber ajuda, porém quando eu pergunto, 'oque eu tenho que fazer?" , o pessoal entende "faz pra mim?" , eu nao pedi script pronto, eu apenas peço ajuda, mas o povo é ignorante pra caramba com iniciantes
  12. Lukkas2201

    Spawn de Veiculo

    bom dia, amigao, sou iniciante eu ja disse, e em nenhum momento eu disse "me entreguem o script pronto por favor", eu só peço ajuda porque eu nao sei oque acontece, eu posto os scripts onde eu acho que seja o problema, se nao quer ajudar é so ignorar o post, simples ué
  13. Lukkas2201

    Spawn de Veiculo

    olá, boa noite, novamente estou aqui, e como ja disse em alguns outros tópicos, sou iniciante, sei que é chato ficar vindo aqui toda hora pedir ajuda em coisas que pra alguns são simples, porém pra alguns outros e eu pode ser complicado. seguinte, estou com meu servidor de dayz com o seguinte erro: o local de spawn de um veiculo é na area 51, fui la peguei o veiculo e guardei em minha base, depois de um tempo, o sistema de backup de veiculos, salva ele na base pra nao perder a localizacao caso de queda do host ou algo do tipo, depois que o carro explode, em vez dele respawnar na 51 que é o seu local de spawn, ele respawna na base, ou seja, ele respawna na onde o backup de veiculos salvou ele, e eu to quebrando a cabeca e nao consigo decifrar, abaixo irei deixar o codigo do spawn de veiculos do server, e tambem do sistema de backup de veiculos. ------------ Sistema de spawn de veiculos do servidor hospitalPacks = { {-2670.87890625,636.8984375,14.453125}, {-2637.0556640625,635.03125,14.453125}, {-1515.669921875,2519.166015625,56.0703125}, {-1513.888671875,2519.5908203125,56.064819335938}, {-1528.8955078125,2516.724609375,55.986171722412}, {2022.1650390625,-1402.6806640625,17.18045425415}, {2042.7001953125,-1409.4775390625,17.1640625}, {1171.490234375,-1310.560546875,13.986573219299}, {1171.609375,-1306.556640625,13.996350288391}, {1158.5048828125,-1326.333984375,31.503561019897}, {1159.80078125,-1323.9013671875,31.498970031738}, {1238.7119140625,328.2431640625,19.7555103302}, {1229.365234375,311.1435546875,24.7578125}, {-2204.07421875,-2309.58203125,31.375}, {1615.939453125,1818.0537109375,10.8203125}, {1601.9443359375,1816.736328125,10.8203125}, {1590.0166015625,1792.0234375,30.46875}, {1607.3232421875,1776.7412109375,37.3125}, {2107.7626953125,926.16015625,10.8203125}, {2116.12890625,925.7705078125,10.9609375}, {2122.1865234375,925.3193359375,10.8203125}, {275.30685424805,1889.0017089844,17.671506881714}, ----- Tenda Medica 51 ------- {275.29724121094,1894.240234375,17.669857025146}, ----- Tenda Medica 51 ------- {246.54913330078,2114.4567871094,17.671398162842}, ----- Tenda Medica 51 ------- {240.98666381836,2114.3959960938,17.670330047607}, ----- Tenda Medica 51 ------- {1389.0604248047,1772.0107421875,10.868975639343}, ----- Tenda Medica Aero LV ------ {-2667.3984375,612.50695800781,14.570329666138}, ------- Tenda Medica HP SF ------- {-2662.3532714844,612.74169921875,14.572191238403}, ------- Tenda Medica HP SF -------- {1612.0623779297,1848.4633789063,10.870816230774}, -------- Tenda Medica HP LV -------- {1605.9671630859,1848.6759033203,10.878125190735}, -------- Tenda Medica HP LV -------- {-1247.9757080078,22.812610626221,14.171301841736}, ------- Tenda Medica Aero SF ------- {-296.43521118164,1084.3815917969,19.771415710449}, ------- Tenda Medica HP FC ----------- {-300.16088867188,1047.8997802734,20.170841217041}, ------- HP FC -------- {-315.2180480957,1046.5977783203,20.207050323486}, -------- HP FC -------- {-325.88632202148,1048.3531494141,20.199048995972}, ------- HP FC -------- {-332.0661315918,1050.5997314453,20.18150138855}, --------- HP FC -------- } patrolPoints = { {-1603.2197265625,-2712.736328125,48.9453125}, {2465.748046875,-2215.55859375,13.546875}, {2473.439453125,-2215.56640625,13.546875}, {2480.0732421875,-2216.140625,13.546875}, {2487.24609375,-2215.5966796875,13.546875}, {2494.1005859375,-2215.5859375,13.546875}, {-1686.6728515625,408.9970703125,7.3984375}, {-1682.34375,412.9384765625,7.3984375}, {-1680.0263671875,402.3642578125,7.3984375}, {-1675.84375,406.4677734375,7.3984375}, {-1670.5615234375,411.8359375,7.3984375}, {-1666.2392578125,416.2509765625,7.3984375}, {-1672.7939453125,422.81640625,7.3984375}, {-1677.20703125,418.46484375,7.3984375}, {-2410.7021484375,969.9091796875,45.4609375}, {-2410.744140625,975.220703125,45.4609375}, {-2410.837890625,980.5302734375,45.4609375}, {-1329.3046875,2668.5126953125,50.46875}, {-1328.7314453125,2673.90625,50.0625}, {-1327.0185546875,2679.3876953125,50.46875}, {-1327.3798828125,2684.62890625,50.0625}, {1940.7099609375,-1778.5244140625,13.390598297119}, {1940.6552734375,-1774.908203125,13.390598297119}, {1940.630859375,-1771.728515625,13.390598297119}, {1940.7080078125,-1767.3837890625,13.390598297119}, {-1477.921875,1868.138671875,32.639846801758}, {-1466.1552734375,1869.0048828125,32.6328125}, {-1464.5224609375,1861.3828125,32.639846801758}, {-1477.4599609375,1860.5205078125,32.6328125}, {-735.9208984375,2744.0087890625,47.2265625}, {-739.0439453125,2744.2421875,47.165451049805}, {377.6953125,2601.1083984375,16.484375}, {624.5263671875,1676.25390625,6.9921875}, {620.2958984375,1681.2431640625,6.9921875}, {616.248046875,1686.4169921875,7.1875}, {612.783203125,1691.1650390625,7.1875}, {609.2060546875,1696.201171875,7.1875}, {605.8505859375,1700.978515625,7.1875}, {602.27734375,1706.3603515625,7.1875}, {2141.037109375,2742.734375,10.960174560547}, {2142.3115234375,2752.6982421875,10.96019744873}, {2147.9521484375,2752.3203125,10.8203125}, {2152.60546875,2751.953125,10.8203125}, {2152.984375,2743.85546875,10.8203125}, {2147.75,2743.7392578125,10.8203125}, {-97.6298828125,-1175.0283203125,2.4990689754486}, {-90.74609375,-1177.853515625,2.2021217346191}, {-84.75390625,-1163.853515625,2.3359375}, {-91.5771484375,-1160.5732421875,2.4453125}, {-1606.525390625,-2717.2138671875,48.9453125}, {-1609.7109375,-2721.544921875,48.9453125}, {-1599.83203125,-2708.302734375,48.9453125}, {-2246.314453125,-2558.8212890625,32.0703125}, {-2241.3125,-2561.3662109375,32.0703125}, {-1132.2880859375,-135.0986328125,14.14396572113}, {-1153.529296875,-156.373046875,14.1484375}, {-1142.826171875,-145.67578125,14.14396572113}, {655.611328125,-557.9912109375,16.501491546631}, {655.6572265625,-572.1728515625,16.501491546631}, {1601.791015625,2203.90625,11.060997009277}, {1596.806640625,2203.4345703125,10.8203125}, {1590.197265625,2203.4853515625,10.8203125}, {1589.4775390625,2195.43359375,10.8203125}, {1596.125,2194.294921875,10.8203125}, {1601.6591796875,2194.3369140625,10.8203125}, {2206.8466796875,2470.47265625,10.8203125}, {2206.94140625,2474.75,10.8203125}, {2206.9267578125,2478.86328125,10.8203125}, {2198.06640625,2480.6953125,10.8203125}, {2197.541015625,2475.791015625,10.995170593262}, {2197.609375,2471.9169921875,10.995170593262}, {2120.8251953125,915.4833984375,10.8203125}, {2115.1181640625,915.44140625,10.8203125}, {2109.076171875,915.4228515625,10.8203125}, {2109.22265625,924.8779296875,10.9609375}, {2114.9404296875,924.8857421875,10.9609375}, {2119.5126953125,925.2861328125,10.9609375}, {2645.7197265625,1112.7802734375,10.8203125}, {2639.984375,1112.56640625,10.8203125}, {2634.828125,1112.3466796875,10.9609375}, {2634.1826171875,1101.9482421875,10.8203125}, {2636.7509765625,1101.6748046875,10.8203125}, {2643.5126953125,1101.81640625,10.8203125}, {2209.576171875,2469.8251953125,10.8203125}, {2208.8310546875,2475.09375,10.8203125}, {1005.078125,-901.7490234375,42.216625213623}, {993.025390625,-902.474609375,42.222496032715}, } lootItems = { helicrashsides = { {"Compass",1851,1,0,2}, {"Scrap Metal",1577,1,0,3}, {"Stinger",2899,0.3,0,3}, {"Tire Repair Kit",2015,0.5,0,4}, {"Hose",1880,0.5,0,6}, {"Syringe",2000,1,0,6}, {"Night Vision Goggles",368,1,90,10}, {"Box of Matches",328,0.4,90,2}, {"Hunting Knife",335,1,90,4}, {"Chainsaw",341,1,90,4}, {"Hatchet",339,1,90,3}, {"Pizza",1582,1,0,2}, {"Soda Bottle",2647,1,0,2}, {"Empty Gas Canister",1650,1,0,2}, {"Roadflare",324,1,90,2}, {"Grenade",342,1,0,2}, {"Parachute",342,1,0,2}, {"Watch",2710,1,0,4}, {"Crossbow",357,1,90,6}, {"Night Vision Goggles",368,1,90,1.5}, {"Tire",1073,1,0,2}, {"GPS",2976,0.15,0,3}, {"Map",1277,0.8,90,7}, {"Toolbox",2969,0.5,0,1}, {"Engine",929,0.3,0,2}, {"Main Rotor Assembly",929,0.3,0,2}, {"Tent",1279,1,0,3.5}, {"Infrared Goggles",369,1,90,3}, }, hospital = { {"Syringe",2000,1,0}, {"Antibiotics",1919,2.1,0}, {"Medic Kit",2891,0.7,0}, {"Heat Pack",1576,1,0}, {"Bandage",1578,0.5,0}, {"Blood Bag",1580,1,0}, {"Morphine",1579,1,0}, {"Blood Bag",1580,1,0}, {"Medic Kit",2891,0.7,0}, {"Blood Bag",1580,1,0}, {"Painkiller",1580,1,0} } } for i,bpData in pairs(BackpacksTable)do table.insert(lootItems.helicrashsides,{bpData[1],bpData[3],1,0,bpData[4][5]}) end function updateHospitals() for i,box in pairs(hospitalCol)do for _,items in ipairs(lootItems.hospital)do setElementData(hospitalCol[i],items[1],math.random(1,5)) end end setTimer(updateHospitals,3600000,1) end hospitalCol = {} function createHospitalPacks() number1 = 0 for i,box in ipairs(hospitalPacks)do number1 = number1 + 1 local x,y,z = box[1],box[2],box[3] object = createObject(1558,x,y,z) setObjectScale(object,1) hospitalCol[i] = createColSphere(x,y,z,2) setElementData(hospitalCol[i],"parent",object) setElementData(hospitalCol[i],"hospitalbox",true) setElementData(hospitalCol[i],"MAX_Slots",20) for _,items in ipairs(lootItems.hospital)do local randomNumber = math.random(1,10) if randomNumber >= 5 then setElementData(hospitalCol[i],items[1],math.random(1,5)) end end end setTimer(updateHospitals,3600000,1) end createHospitalPacks() patrolCol = {} for num,patrol in ipairs(patrolPoints) do local x,y,z = patrol[1],patrol[2],patrol[3] patrolCol[num] = createColSphere(x,y,z,3) setElementData(patrolCol[num],"patrolstation",true) local rand = math.random(1,15) if rand == 1 then lts = 100 elseif rand == 2 or rand == 3 then lts = 80 elseif rand >= 4 or rand <= 6 then lts = 60 elseif rand >= 7 or rand <= 10 then lts = 40 else lts = 20 end setElementData(patrolCol[num],"patrollts",lts) end function updatepatrol() for i,box in pairs(patrolCol) do local rand = math.random(1,15) if rand == 1 then lts = 100 elseif rand == 2 or rand == 3 then lts = 80 elseif rand >= 4 or rand <= 6 then lts = 60 elseif rand >= 7 or rand <= 10 then lts = 40 else lts = 20 end setElementData(patrolCol[i],"patrollts",lts) end end setTimer(updatepatrol,10800000,0) function spawnDayZVehicles() for _, data in ipairs(vehicleSpawns) do veh = createVehicle(data[1],data[2],data[3],data[4]) vehCol = createColSphere(data[2],data[3],data[4],2.5) attachElements(vehCol,veh,0,0,0) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) local tires,engine,parts = getVehicleAddonInfos(getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) setElementData(vehCol,"Tire_inVehicle_HP",400) setElementData(vehCol,"Engine_inVehicle_HP",400) setElementData(vehCol,"Parts_inVehicle_HP",400) setElementData(vehCol,"armorPointsMax",data[6]) setElementData(vehCol,"armorPoints",0) setElementData(vehCol,"vehicle:station",0) setElementData(vehCol,"receiver",0) setVehicleHeadLightColor(veh,math.random(0,255),math.random(0,255),math.random(0,255)) setElementData(vehCol,"fuel",10) setElementData(vehCol,"MAX_Slots",data[5]) setElementData(vehCol,"spawn",{data[1],data[2],data[3],data[4]}) end end function spawnVehiclePack(ps,cmd) if getElementData(ps,"admin") then spawnDayZVehicles() outputChatBox("SVP Sucess!",ps,8, 193, 207,true) end end addCommandHandler("svp",spawnVehiclePack) function notifyAboutExplosion() occupants = getVehicleOccupants(source) or {} for _,peds in pairs(occupants)do removePedFromVehicle(peds) end local col = getElementData(source,"parent") -- if col and getElementData(col,"helicrash") then return end id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots")) setElementData(col,"deadVehicle",true) setElementData(source,"isExploded",true) x1,y1,z1 = getElementPosition(source) createExplosion(x1+1,y1+1,z1,4) createExplosion(x1-1,y1-1,z1,4) createExplosion(x1+1,y1-1,z1,4) createExplosion(x1-1,y1+1,z1,4) end addEventHandler("onVehicleExplode",getRootElement(),notifyAboutExplosion) function respawnVehiclesInWater(vehiclesInWater) for i,veh in ipairs(getElementsByType("vehicle"))do if isElementInWater(veh) and getVehicleType(veh) ~= "Boat" then local col = getElementData(veh,"parent") id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] respawnDayZVehicle(id,x,y,z,veh,col) end end end setTimer(respawnVehiclesInWater,1800000,0) function respawnDayZVehicle(id,x,y,z,veh,col,max_slots) local armorMax = getElementData(col,"armorPointsMax") destroyElement(veh) destroyElement(col) veh = createVehicle(id,x,y,z+1) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",max_slots) --Engine + Tires local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) setElementData(vehCol,"Tire_inVehicle_HP",400) setElementData(vehCol,"Engine_inVehicle_HP",400) setElementData(vehCol,"Parts_inVehicle_HP",400) setElementData(vehCol,"armorPointsMax",armorMax) setElementData(vehCol,"armorPoints",0) setVehicleHeadLightColor(veh,math.random(0,255),math.random(0,255),math.random(0,255)) setElementData(vehCol,"receiver",0) setElementData(vehCol,"vehicle:station",0) --vehicle_indentifikation setElementData(vehCol,"spawn",{id,x,y,z}) --others setElementData(vehCol,"fuel",10) end function onPlayerEnterDayzVehicle(veh,seat) local col = getElementData(veh,"parent") local id = getElementModel(veh) local tires,engine,parts = getVehicleAddonInfos (id) setElementData(veh,"maxfuel",getVehicleMaxFuel(col)) setElementData(veh,"needtires",tires) setElementData(veh,"needengine",engine) setElementData(veh,"needparts",parts) if ((getElementData(col,"Tire_inVehicle") or 0) < tonumber(tires)) then setVehicleEngineState(veh,false) return end if ((getElementData(col,"Engine_inVehicle") or 0) < tonumber(engine)) then setVehicleEngineState(veh,false) return end if ((getElementData(col,"Parts_inVehicle") or 0) < tonumber(parts)) then setVehicleEngineState(veh,false) return end if (getElementData(col,"fuel") or 0) <= 1 then if not getElementModel(veh) == 510 then setVehicleEngineState(veh,false) return end end end addEventHandler("onPlayerVehicleEnter",getRootElement(),onPlayerEnterDayzVehicle) function setEngineState(player,key,keyState) local theVehicle = getPedOccupiedVehicle(player) if theVehicle and getVehicleController(theVehicle) == player then if checkVehicleMovable(theVehicle) then setVehicleEngineState(theVehicle, not getVehicleEngineState(theVehicle)) end end end function checkVehicleMovable(veh) if isElement(veh) then local parent = getElementData(veh,"parent") if parent then if ((getElementData(parent,"Tire_inVehicle") or 0) ~= getElementData(veh,"needtires")) then setVehicleEngineState(veh,false) return false end if ((getElementData(parent,"Engine_inVehicle") or 0) ~= getElementData(veh,"needengine")) then setVehicleEngineState(veh,false) return false end if ((getElementData(parent,"Parts_inVehicle") or 0) ~= getElementData(veh,"needparts")) then setVehicleEngineState (veh,false) return false end return true end end end function onPlayerExitDayzVehicle(veh,seat) if seat == 0 then setVehicleEngineState (veh,false) end unbindKey(source,"k","down",setEngineState) end addEventHandler("onPlayerVehicleExit",getRootElement(),onPlayerExitDayzVehicle) function setVehiclesFuelPerMinute () for i,veh in ipairs(getElementsByType("vehicle")) do if getVehicleEngineState(veh) == true then if getElementData(getElementData(veh,"parent"),"fuel") >= 0 then setElementData(getElementData(veh,"parent"),"fuel",getElementData(getElementData(veh,"parent"),"fuel")-getVehicleFuelRemove(getElementModel(veh),getElementData(veh,"parent"))) else setVehicleEngineState ( veh, false ) end end end end setTimer(setVehiclesFuelPerMinute,20000,0) function isVehicleReadyToStart2 (veh) if getElementData(getElementData(veh,"parent"),"fuel") >= 1 then local tires,engine,parts,metal = getVehicleAddonInfos (getElementModel(veh)) if (getElementData(getElementData(veh,"parent"),"Tire_inVehicle") or 0) > tonumber(tires) and (getElementData(getElementData(veh,"parent"),"Engine_inVehicle") or 0) > tonumber(engine) and (getElementData(getElementData(veh,"parent"),"Parts_inVehicle") or 0) > tonumber(parts) then setVehicleEngineState ( veh, true ) end end setTimer(isVehicleReadyToStart2,1000,1,veh) end repairTimer = {} function repairVehicle (veh) if repairTimer[veh] then triggerClientEvent (source, "displayClientInfo", source,"Vehicle"," is currently being repaired!",255,22,0) return end local health = math.floor(getElementHealth(veh)) repairTimer[veh] = setTimer(fixVehicleDayZ, 25000, 1, veh, source) setElementFrozen (veh,true) setElementData(veh,"repairer",source) setElementData(source,"repairingvehicle",veh) setPedAnimation (source,"SCRATCHING","sclng_r",nil,false,false) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","Você começou a reparar o veículo, aguarde...",255,0,0) end addEvent("repairVehicle",true) addEventHandler("repairVehicle",getRootElement(),repairVehicle) function fixVehicleDayZ(veh,player) setElementHealth(veh,1000) fixVehicle (veh) setPedAnimation(player,false) setElementFrozen (veh,false) setVehicleDamageProof (veh,false) repairTimer[veh] = nil setElementData(veh,"repairer",nil) setElementData(player,"repairingvehicle",nil) triggerClientEvent (player, "displayClientInfo", player,"Vehicle","Você terminou de reparar o veículo.",22,255,0) end function stopFixxingWhileMoving() local veh = getElementData(source,"repairingvehicle") setPedAnimation(source) setElementFrozen (veh,false) setVehicleDamageProof (veh,false) setElementData(veh,"repairer",nil) setElementData(source,"repairingvehicle",nil) setElementData(source,"Repairing",false) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","Você parou de reparar o veículo.",22,255,0) killTimer(repairTimer[veh]) repairTimer[veh] = nil end addEvent("onClientMovesWhileAnimation",true) addEventHandler("onClientMovesWhileAnimation",getRootElement(),stopFixxingWhileMoving) function debugFixxing() for i,veh in ipairs(getElementsByType("vehicle")) do if getElementData(veh,"repairer") == source then setVehicleDamageProof (veh,false) outputDebugString("Vehicle repairer disconnected - destroyed tables") killTimer(repairTimer[veh]) setElementFrozen (veh,false) repairTimer[veh] = nil setElementData(veh,"repairer",nil) end end end addEventHandler("onPlayerQuit",getRootElement(),debugFixxing) --------- sistema de backup dos veiculos needToSave = { {"MAX_Slots"}, {"Tire_inVehicle"}, {"Engine_inVehicle"}, {"Parts_inVehicle"}, {"Tire_inVehicle_HP"}, {"Engine_inVehicle_HP"}, {"Parts_inVehicle_HP"}, {"armorPointsMax"}, {"armorPoints"}, {"fuel"}, {"maxfuel"}, {"needengine"}, {"needtires"}, {"needparts"}, {"receiver"}, } function SaveVehicles(player) if isElement(player) then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then return end end fileDelete("SaveSystem/XVehicles.xml") xml = xmlCreateFile("SaveSystem/XVehicles.xml","config") xmlSaveFile(xml) count = 0 for _,vehCol in pairs(getElementsByType("colshape")) do if getElementData(vehCol,"vehicle") and not getElementData(vehCol,"tent") then count = count + 1 if getElementData(vehCol,"parent") and isElement(getElementData(vehCol,"parent")) then veh = getElementData(vehCol,"parent") slots = getElementData(vehCol,"MAX_Slots") health = getElementHealth(veh) x,y,z = getElementPosition(veh) rx,ry,rz = getElementRotation(veh) VehInfos = xmlCreateChild(xml,"Veh") xmlNodeSetAttribute(VehInfos,"Name",getVehicleName(veh)) xmlNodeSetAttribute(VehInfos,"ID",getElementModel(veh)) xmlNodeSetAttribute(VehInfos,"Health",math.floor(health)) xmlNodeSetAttribute(VehInfos,"X",x) xmlNodeSetAttribute(VehInfos,"Y",y) xmlNodeSetAttribute(VehInfos,"Z",z) xmlNodeSetAttribute(VehInfos,"RX",rx) xmlNodeSetAttribute(VehInfos,"RY",ry) xmlNodeSetAttribute(VehInfos,"RZ",rz) VehItens = xmlCreateChild(VehInfos,"Itens") for _,item in pairs(vehicleDataTable)do if(tonumber(getElementData(vehCol,item[1])) and getElementData(vehCol,item[1]) >= 1) then Item2 = xmlCreateChild(VehItens,"Item") xmlNodeSetAttribute(Item2,"Item",item[1]) xmlNodeSetAttribute(Item2,"Quant",getElementData(vehCol,item[1]) or 0) end end for _,item in pairs(needToSave)do Item2 = xmlCreateChild(VehItens,"Item") xmlNodeSetAttribute(Item2,"Item",item[1]) xmlNodeSetAttribute(Item2,"Quant",getElementData(vehCol,item[1]) or 0) end end end end xmlSaveFile(xml) xmlUnloadFile(xml) if isElement(player) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then outputChatBox("#FFFFFFQuantidade de Veículos Salvos #FF0000*#FFFFFF"..count.."#FF0000*",player,255,0,0,true) end end end addEventHandler("onResourceStop",getResourceRootElement(),SaveVehicles) setTimer(SaveVehicles,10000,0) function LoadVehicles(player) if isElement(player) then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then return end end xml = xmlLoadFile("SaveSystem/XVehicles.xml") for i,node in pairs(xmlNodeGetChildren(xml)) do x = tonumber(xmlNodeGetAttribute(node,"X")) y = tonumber(xmlNodeGetAttribute(node,"Y")) z = tonumber(xmlNodeGetAttribute(node,"Z")) rx = tonumber(xmlNodeGetAttribute(node,"RX")) ry = tonumber(xmlNodeGetAttribute(node,"RY")) rz = tonumber(xmlNodeGetAttribute(node,"RZ")) veh = createVehicle(tonumber(xmlNodeGetAttribute(node,"ID")),x,y,z,rx,ry,rz) vehCol = createColSphere(x,y,z,4) setElementData(vehCol,"spawn",{tonumber(xmlNodeGetAttribute(node,"ID")),x,y,z}) attachElements(vehCol,veh,0,0,0) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementHealth(veh,tonumber(math.floor(xmlNodeGetAttribute(node,"Health")))) for i,Item in pairs(xmlNodeGetChildren(xmlFindChild(node,"Itens",0))) do setElementData(vehCol,xmlNodeGetAttribute(Item,"Item"),tonumber(xmlNodeGetAttribute(Item,"Quant"))) end end xmlUnloadFile(xml) if isElement(player) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))then outputChatBox("Todos os Veículos foram salvos com sucesso",player,255,0,0,true) end end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),LoadVehicles) addCommandHandler("savevehs",SaveVehicles) addCommandHandler("loadvehs",LoadVehicles)
  14. Lukkas2201

    Erro Inventory

    e como eu faço isso? ja tentei varias maneiras e n consegui
  15. Lukkas2201

    Erro Inventory

    sim mas eu teria que adicionar um true na linha 348 ou 349? ou trocar o numbers por um numero, eu n entendi