Jump to content

RandomRambo

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by RandomRambo

  1. Hello guys. How I can remove function(?) or idk what when player is close to loot and another one player is close too, the menu just going to disable and inventory just closing. How is it possible to fix if 2 players close to loot spawn the menu and inventory won't be closed (I think the creator did it to avoid dupe,but I need to remove it). I know that it is somewhere in menu_client.lua,I tried to find what is responsible for it in this file but I didn't find. If anyone knows,help please. menu_clent.lua: 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} {500,4,1,1}, --Mesa {568,4,1,1}, --Bandito {512,0,1,1}, --Cropduster {476,0,1,1}, --rust {483,4,1,1}, --camper {422,4,1,1}, --Bobcat {470,4,1,1}, --Patriot {471,4,1,1}, --Quad {404,4,1,1}, --Perenniel {531,4,1,1}, --Tractor {468,2,1,1}, --Sanchez {433,6,1,1}, --Barracks {437,6,1,1}, --Coach {509,0,0,0}, --Bike {487,0,1,1}, --Maverick {497,0,1,1}, --Police Maverik {453,0,1,1} -- Reffer } 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 == "Take" then startRollMessageMenu("Подобрать "..arg2,50,255,50,arg2) setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then startRollMessageMenu("Обыскать",255,255,255,"helicrashsite") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Hospitalbox" then startRollMessageMenu("Содержимое",255,255,255,"hospitalbox") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Vehicle" then startRollMessageMenu("Содержимое ("..arg2.."): "..getLootCurrentSlots(arg4).."/"..(getElementData(arg4,"MAX_Slots") or 0).." слотов",0,255,0,"vehicle") setElementData(localPlayer,"usedItemTrue", true) if getElementData(getElementData(arg3,"parent"),"tent") then startRollMessageMenu("Убрать палатку",0,255,0,"tent") return end --2 if getElementHealth(arg3) < 1000 and getElementHealth(arg3) >= 50 then startRollMessageMenu("Починить ("..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("Заправить ("..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("Слить бензин ("..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,"Колесо_inVehicle") or 0) < tires then startRollMessageMenu("Поставить колесо ("..(getElementData(arg4,"Колесо_inVehicle") or 0).."/"..tires..")",255,0,0,"TireOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Двигатель_inVehicle") or 0) < engine then startRollMessageMenu("Поставить двигатель ("..(getElementData(arg4,"Двигатель_inVehicle") or 0).."/"..engine..")",255,0,0,"EngineOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) < parts then startRollMessageMenu("Поставить Бензобак ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",255,0,0,"PartsOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Колесо_inVehicle") or 0) > 0 then startRollMessageMenu("Снять колесо ("..(getElementData(arg4,"Колесо_inVehicle") or 0).."/"..tires..")",255,255,0,"TireTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Двигатель_inVehicle") or 0) > 0 then startRollMessageMenu("Снять двигатель ("..(getElementData(arg4,"Двигатель_inVehicle") or 0).."/"..engine..")",255,255,0,"EngineTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) > 0 then startRollMessageMenu("Снять Бензобак ("..(getElementData(arg4,"Parts_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(),"Бинт") >= 1 then startRollMessageMenu("Перевязать",255,255,255,"bandage") setElementData(localPlayer,"usedItemTrue", true) end if getElementData(arg2,"blood") < 11900 and getElementData(getLocalPlayer(),"Пакет крови") >= 1 then startRollMessageMenu("Пополнить кровь",255,255,255,"giveblood") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Dead" then startRollMessageMenu("Содержимое ("..arg2..")",0,255,0,"dead") startRollMessageMenu("Осмотреть тело",0,255,0,"deadreason") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"Сырое мясо") >= 1 then startRollMessageMenu("Приготовить мясо",255,255,255,"fireplace") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "patrol" then if getElementData(getLocalPlayer(),"Пустая канистра") >= 1 then startRollMessageMenu("Наполнить канистру",255,255,255,"patrolstation") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Wirefence" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then startRollMessageMenu("Убрать проволоку",255,255,255,"wirefence") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "SandBags" then if getElementData(getLocalPlayer(),"Лопата") >= 1 then startRollMessageMenu("Убрать мешки с песком",255,255,255,"sandbags") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Mine" then if getElementData(getLocalPlayer(),"Лопата") >= 1 then startRollMessageMenu("Убрать мину",255,255,255,"wirefence") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Содержимое" then startRollMessageMenu("Содержимое",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 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,"АЗС","Нажмите среднюю кнопку мыши для того чтобы нполнить канистру!\n Необходима: Пустая канистра",source) return end if getElementData(source,"wirefence") then showClientMenuItem("Wirefence") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Wirefence","Нажмите среднюю кнопку мыши для того чтобы убрать проволоку!\n Необходимы: Инструменты",source) return end if getElementData(source,"sandbags") then showClientMenuItem("SandBags") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Мешки с песком","Нажмите среднюю кнопку мыши чтобы убрать мешки с песком!\n Требуется:Лопата",source) return end if getElementData(source,"mine") then showClientMenuItem("Mine") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Мина","Нажмите среднюю кнопку мыши чтобы убрать Мину!\n Требуется:Лопата",source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fireplace") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Fireplace","Нажмите среднюю кнопку мыши для того чтобы приготовить мясо!\n Необходимо: Сырое мясо",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","Осмотреть ("..getElementData(source,"playername")..")") setNewbieInfo (true,"Содержимое","Нажмите J чтобы открыть инвентарь!",source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Содержимое","Нажмите среднюю кнопку мыши чтобы подобрать предмет!",source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrashsite","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Обыскать") --(Helicrash) setNewbieInfo (true,"Содержимое","Нажмите J чтобы открыть инвентарь!",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Обыскать (Hospitalbox)") setNewbieInfo (true,"Содержимое","Нажмите J чтобы открыть инвентарь!",source) return end if getElementData(source,"vehicle") then if not getElementData(source,"deadVehicle") then showClientMenuItem("Vehicle",(getVehicleName(getElementData(source,"parent")) or "Палатка"),getElementData(source,"parent"),source) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Обыскать ("..(getVehicleName(getElementData(source,"parent")) or "Палатка")..")") setNewbieInfo (true,"Содержимое","Нажмите J чтобы открыть инвентарь!",source) return end end if getElementData(source,"itemloot") then showClientMenuItem("Содержимое") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Содержимое") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo (true,"Содержимое","Нажмите J чтобы открыть инвентарь!",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 = 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 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 x then 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 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 = "Обыскать (Helicrash)" -- Helicrash refreshLoot(col,gearName) showInventoryManual() return end if itemName == "itemloot" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Содержимое" 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 = "Убрать мешки с песком" triggerServerEvent("removeSandBags",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end if itemName == "mine" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Убрать мину" triggerServerEvent("removeSandBags",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end if itemName == "hospitalbox" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Обыскать (Hospitalbox)" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "vehicle" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Обыскать ("..(getVehicleName(getElementData(col,"parent")) or "Палатка")..")" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "repairvehicle" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelOne" then if (getElementData(getLocalPlayer(),"Наполненная канистра") 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","Бак полный!",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","Из транспорта вылилась часть бензина!",22,255,0) end setElementData(getLocalPlayer(),"Наполненная канистра",getElementData(getLocalPlayer(),"Наполненная канистра")-1) setElementData(getLocalPlayer(),"Пустая канистра",(getElementData(getLocalPlayer(),"Пустая канистра") or 0)+1) setElementData(col,"fuel",getElementData(col,"fuel")+addingfuel) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Транспорт заправлен на "..addingfuel.." л.!",22,255,0) else startRollMessage2("Inventory", "У Вас нет пустой канистры!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelTwo" then if (getElementData(getLocalPlayer(),"Пустая канистра") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(getLocalPlayer(),"Наполненная канистра",getElementData(getLocalPlayer(),"Наполненная канистра")+1) setElementData(getLocalPlayer(),"Пустая канистра",(getElementData(getLocalPlayer(),"Пустая канистра") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) setElementData(col,"fuel",getElementData(col,"fuel")-20) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Вы слили 20л. бензина!",22,255,0) else startRollMessage2("Inventory", "У Вас нет пустой канистры!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireOne" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then if (getElementData(getLocalPlayer(),"Колесо") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Колесо_inVehicle",(getElementData(col,"Колесо_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Колесо",(getElementData(getLocalPlayer(),"Колесо") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы поставили одно колесо!", 22, 255, 0 ) else startRollMessage2("Inventory", "У Вас нет колес!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireTwo" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Колесо_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Колесо_inVehicle",(getElementData(col,"Колесо_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Колесо",(getElementData(getLocalPlayer(),"Колесо") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы сняли одно колесо!", 22, 255, 0 ) else startRollMessage2("Inventory", "В транспорте нет колес!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineOne" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then if (getElementData(getLocalPlayer(),"Двигатель") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Двигатель_inVehicle",(getElementData(col,"Двигатель_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Двигатель",(getElementData(getLocalPlayer(),"Двигатель") or 0)-1) ---triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы поставили один двигатель!", 22, 255, 0 ) else startRollMessage2("Inventory", "У Вас нет двигателя!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineTwo" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Двигатель_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Двигатель_inVehicle",(getElementData(col,"Двигатель_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Двигатель",(getElementData(getLocalPlayer(),"Двигатель") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы сняли один двигатель!", 22, 255, 0 ) else startRollMessage2("Inventory", "В транспорте нет двигателя!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsOne" then if getElementData(getLocalPlayer(),"Инструменты") >= 1 then if (getElementData(getLocalPlayer(),"Бензобак") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Бензобак",(getElementData(getLocalPlayer(),"Бензобак") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы поставили Бензобак!", 22, 255, 0 ) else startRollMessage2("Inventory", "У Вас нет Бензобака!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsTwo" then if getElementData(getLocalPlayer(),"Инструменты") >= 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(),"Бензобак",(getElementData(getLocalPlayer(),"Бензобак") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Вы сняли Бензобак!", 22, 255, 0 ) else startRollMessage2("Inventory", "В транспорте нет Бензобака!", 255, 22, 0 ) end else startRollMessage2("Inventory", "У Вас нет Инструментов!", 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 == "бинт" 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 = "Содержимое ("..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(),"Пустая канистра",getElementData(getLocalPlayer(),"Пустая канистра")-1) setElementData(getLocalPlayer(),"Наполненная канистра",(getElementData(getLocalPlayer(),"Наполненная канистра") or 0)+1) triggerEvent ("displayClientInfo",getLocalPlayer(),"patrolstation","Канистра заполнена!",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 if itemName == "Assault Pack (ACU)" or itemName == "Alice Pack" or itemName == "Czech Backpack" or itemName == "Рюкзак Military" or itemName =="Serial Backpack" or itemName == "Coyote Backpack" 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") 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", "Инвентарь заполнен!", 255, 22, 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 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
  2. Now it works perfectly!Thanks a lot
  3. ye I put 30 mins delay And when i hit 5 times marker,on the sixth try it let me hit it again
  4. Doesn't work ? It lets people to hit marker unlimited times anyway ?
  5. Thanks,but how can I do that may be after 5 guys hit the marker it will be closed like this?(not 1 like now)
  6. Hi guys. Need some help with DX , I have some code and I need to put an image in the background of this window. Tryed guiCreateStaticImage But it doesn't work correctly or doesn't work at all ? I know that here is dxDrawRectangle but I need instead of this black "window" a transparent image behind this window. Help if u know how to do it. Code: function Render() if getElementData(localPlayer,"inMenu") == true then destroyWorkWindow() end dxDrawRectangle(x-450, y-292, 900, 400, tocolor ( 0, 0, 0, 210) ) dxDrawRectangle(x-410, y-242, 350, 320, tocolor ( 255, 255, 255, 80) ) twd = dxGetTextWidth(getElementData(isReal(),"name"), 1.3, "default-bold") dxDrawText(getElementData(isReal(),"name"),x-245-twd/2, y-272, 350, 500,tocolor (181,166,66, 255 ), 1.3, "default-bold") start = -10 for i, v in ipairs(works) do if i == qtLabelEntered and qtLabelSelected ~= i then dxDrawRectangle(x-410, y-232+start, 350, 35, tocolor ( 180, 180, 180, 210) ) elseif i == qLabelSelected then dxDrawRectangle(x-410, y-232+start, 350, 35, tocolor ( 181,166,66, 210) ) if qtAcceptEntered == 1 then dxDrawRectangle(x+10,y+28,400,50, tocolor( 181,166,66, 80)) else dxDrawRectangle(x+10,y+28,400,50, tocolor( 255, 255, 255, 80)) end local checkWork = getElementData(localPlayer,"works") or 0 if checkWork == v.works then twd = dxGetTextWidth("Accept",1.3,"default-bold") dxDrawText("Accept",x+210-twd/2,y+43,400,50,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") else twd = dxGetTextWidth("Go",1.3,"default-bold") dxDrawText("Go",x+210-twd/2,y+43,400,50,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") end end if getElementData(isReal(),"id") == v.works then twd = dxGetTextWidth(v.name,1.3,"default-bold") dxDrawText(v.name,x-245-twd/2, y-232+start+5, 350, 500,tocolor ( 255,255,255, 255 ), 1.3, "default-bold") start = start + 35 end end end
  7. Close this thread,found solution.
  8. Still searching better solution for this function.. If u can help,help please.
  9. Okay,but what with " I need everyone can see changed model (not only me)"?
  10. Thanks but I need everyone can see changed model (not only me) I checked ur script,u just hide models with empty dff but if I do this, original model of melee weapon (I have gun on original model) will hide too,am I right?
  11. Can u give me an example,please?
  12. Hello guys. I just tryed to do more weapons on DayZ mode. I downloaded some random DayZ mode and found system for weapons on 1 id. Tryed to move this function in my mode and I did it. Everything is good,but if I take this gun (which I added on 1 id with another model) I get 2 models in my hand (1 basic and 1 mine) (btw it's secondary melee weapon). How I can hide basic model of gun If I take weapon which I added on this same ID?Help,please. There is the function: elementWeaponRaplace = {} elementWeaponRaplace2 = {} raplaceSettings = { ["Hatchet Of God"] = { twohand = false, model = 2326 }, } function weaponReplace ( previousWeaponID, currentWeaponID ) local weapon1 = getElementData(source,"currentweapon_1") local weapon2 = getElementData(source,"currentweapon_2") if not weapon1 and not weapon2 then return end local ammoData1,weapID1 = getWeaponAmmoType(weapon1) local ammoData2,weapID2 = getWeaponAmmoType(weapon2) local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) local curweap if currentWeaponID == weapID1 then curweap = weapon1 elseif currentWeaponID == weapID2 then curweap = weapon2 end if isElement(elementWeaponRaplace[source]) then detachElementFromBone(elementWeaponRaplace[source]) destroyElement(elementWeaponRaplace[source]) elementWeaponRaplace[source] = false end if isElement(elementWeaponRaplace2[source]) then detachElementFromBone(elementWeaponRaplace2[source]) destroyElement(elementWeaponRaplace2[source]) elementWeaponRaplace2[source] = false end if curweap and raplaceSettings[curweap] then elementWeaponRaplace[source] = createObject(raplaceSettings[curweap].model,x,y,z) setElementData(source,"weaponSwithModel",elementWeaponRaplace[source]) attachElementToBone(elementWeaponRaplace[source],source,12,0,0,0,180,90,180) if raplaceSettings[curweap].twohand then elementWeaponRaplace2[source] = createObject(raplaceSettings[curweap].model,x,y,z) attachElementToBone(elementWeaponRaplace2[source],source,11,0,0.05,0,180,100,0) end end end addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) weaponModels = { ---- ["Hatchet Of God"] = { coords = {14,0.11,0,0,180,90,270}, coords2 = {14,0.11,0,0,180,90,270}, id = 4, model = 2326}, ---- }
  13. Thanks a lot!Everything works perfectly!
  14. ye,it works ,thank you so much And I just realised,is it possible that when it shows notifications (it shows just HP of bot in numbers),is it possible to show like this - "Bot hp: "here is numbers"".I mean is it possbile to show also text "bot hp:" May be like this?: triggerClientEvent(source, "add:notification", source,"bot hp:", zombieHealth, "info", true) am I right?
  15. Should I just put this in fuction without deleting anything?
  16. hey,I have script of bots zombie ; I need to show info about their hp after player hit them. I tryed to show it in chat: outputChatBox("blood "..tostring(getElementData ( zomb,'blood' ))) And it works fine,but I want to do it in notifications: triggerClientEvent(source, "add:notification", source, "..tostring(getElementData ( zomb,'blood' ))", "info",true) But it doesn't work (I have this resource turned on notifications ) Help please,how I can show bot's HP with these notifications ?
  17. Im talking about custom voice to change (with mp3 or wav or ogg)
  18. Hello everyone,I need some help. How I can do that : I need this animation to last about 10 seconds for example setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant",nil,false,false,nil,false) How to do this?Help please.
  19. Hello boys. Is it possible to change original voices of skins to custom one?
  20. RandomRambo

    Marker

    Hello guys. Is it real to make this thing. If someone moved on marker,is it possible to not let another player move to this marker (he needs to wait SOME TIME for example). (Marker teleports player to some place btw)
×
×
  • Create New...