Jump to content

RandomRambo

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by RandomRambo

  1. Bro,the problem was in zip archives with scripts xd need just to put out scripts from zip archives
  2. wow,I will try it ,thanks... ye,I think it is hosting's problem but they don't want to fix it
  3. Did it.Nothing happened. Also I just reinstalled full server (everything was deleted),I put mta-1.6.0-21959 build again,downloaded my mode and resourses through ftp to hosting,entered resources into mtaconfig from scratch and it started to work!But..after 4 restarts,it doesn't start again and again server reboots endlessly
  4. Nothing in logs aswell. Windows,strange thing is that it works perfectly on mta-1.6.0-unstable-7976-net41DA but on mta-1.6.0-21959 it restarts all the time and as I said no errors or smth else,just this in console: ================================================================== = Multi Theft Auto: San Andreas v1.6 ================================================================== = Server name : Default MTA Server = Server IP address: ... = Server port : 22081 = = Log file : /game/mods/deathmatch/logs/server.log = Maximum players : 30 = HTTP port : 32081 = Voice Chat : Disabled = Bandwidth saving : Medium ================================================================== and one more thing...where I can download mta 1.6n?Cus it says I need it to join the server on mta-1.6.0-unstable-7976-net41DA build on which it works...
  5. Server on hosting,so I use latest build,no viruses. It works perfectly on 1.5.9 builds,but on 1.6 it just restarts all time and no errors in console Config changed after I installed latest build so config isn't the real problem.
  6. Hello guys,need some help I have server on mta-1.5.7-R4-20359 build and when Im trying to move on mta-1.6.0-21959 build I have a problem. For the first time I changed the build,server starts correctly and mode works fine but when I restart server on this build after it server doesn't start (no errors or smth in console;I attached console text ),BUT when I tried to use mta-1.6.0-unstable-7976-net41DA build it starts and it works fine even if I restart server buuuuut I can't connect to server cus it says :u need mta 1.6n. I thought that I can download mta 1.6n on https://nightly.mtasa.com/ , like I thought it is the latest unstable version of MTA for this build but it's not true. So,what is the problem that my server doesn't start on stable 1.6 build?:( ================================================================== = Multi Theft Auto: San Andreas v1.6 ================================================================== = Server name : Default MTA Server = Server IP address: ... = Server port : 22081 = = Log file : /game/mods/deathmatch/logs/server.log = Maximum players : 30 = HTTP port : 32081 = Voice Chat : Disabled = Bandwidth saving : Medium ================================================================== and the server reboots endlessly..
  7. Waaait,look,now I have 3 col files,1 dff,1 txd (and it is 1 object (model)) So,it doesn't work
  8. Hi guys,how should I replace model if it has 3 dff different files for this model? I know how to replace it when I have 1 txd,1 dff and 1 col files but how to replace with 3 dff,1 txd and 1 col for example? >example of 3 files (txd,dff,col) txd = engineLoadTXD ( "cave.txd" ) engineImportTXD ( txd, 3964 ) col = engineLoadCOL ( "cave.col" ) engineReplaceCOL ( col, 3964 ) dff = engineLoadDFF ( "cave.dff", 0 ) engineReplaceModel ( dff, 3964 ) engineSetModelLODDistance(3964, 160) Help please
  9. Hi guys. Is it possible to change sound of footsteps?
  10. thanks but @AngelAlpha already solved my question
  11. thank u very much,but can u write a client side?xd
  12. wow,thanks And one more question.How I can do if player hit the marker this image and buttons will show to him ("K" button should be removed then) I tried to do smth like that: (server side) marker1 = createMarker(2094.8940429688,-838.72570800781,52.3, "corona", 1.5, 230, 251, 3, 153) function event(player) triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit", root, event) And added function openWindow in client side but it didn't work ?
  13. I asked for help to hide button and @#\_oskar_/# helped me,thanks but now I need that this image with buttons doesn't show before I pressed "K" because at this moment it shows even if someone connected to server (it shows when player connected and he should press "K" to hide it). function AttachDxToGuiElement( GUIElement , img ) if ( guiGetVisible ( GUIElement ) ) then local x, y = guiGetPosition ( GUIElement , false ) local width , Height = guiGetSize ( GUIElement , false ) dxDrawImage(x, y, width , Height ,img, 0, 0, 0,SetImagecolor or tocolor(255, 0, 0, 255), true) dxDrawText(guiGetText ( GUIElement ) or tostring '',x, y, width + x , Height + y,SetTextcolor or tocolor(55,55,55,255),1,"default-bold","center","center",false,false,true) guiBringToFront ( GUIElement ) guiSetAlpha ( GUIElement , 0) end end ------------------ event = guiCreateButton(16, 20, 250, 40, "Take", false) addEventHandler ("onClientRender", root, function () AttachDxToGuiElement( event ,'img/event.png' ) end) bindKey( "k", "down",function( ) guiSetVisible( event , not guiGetVisible( event )) showCursor( guiGetVisible( event )) end ) Help please.I tried everything I know but it didn't help.
  14. Hey bro,can u answer in my thread?

  15. @#\_oskar_/# I did everything I need but how to do that this image with button won't show when it started.I need that it can be show only when someone press 'K',not when resourse is started
  16. When I try to add one more button it shows only 1 button anyway.What am I doing wrong?:\ function AttachDxToGuiElement( GUIElement , img ) if ( guiGetVisible ( GUIElement ) ) then showCursor ( true ) local x, y = guiGetPosition ( GUIElement , false ) local width , Height = guiGetSize ( GUIElement , false ) dxDrawImage(500*sW, 120*sH, 370*sW, 470*sH, "img/event.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText(guiGetText ( GUIElement ) or tostring '',x, y, width + x , Height + y,SetTextcolor or tocolor(223,247,0,255),1,"default-bold","center","center",false,false,true) guiBringToFront ( GUIElement ) guiSetAlpha ( GUIElement , 0) end end ------------------ event = guiCreateButton(740, 800, 250, 40, "Take", false) event1 = guiCreateButton(890, 700, 250, 40, "Take", false) addEventHandler ("onClientRender", root, function () AttachDxToGuiElement( event ,'img/event.png' ) AttachDxToGuiElement( event1 ,'img/event.png' ) end) bindKey( "K", "down",function( ) guiSetVisible( event , not guiGetVisible( event )) guiSetVisible( event1 , not guiGetVisible( event1 )) showCursor( guiGetVisible( event )) showCursor ( false ) end )
  17. Ye,but it shows when I start resource,but It should show if someone jujst press 'K' (not when resource started). And the button doesn't work,it is just as not a button it is just like a text Upd.Button works,but can I just make a button with my image? for example this (and text from button will be on it.Is it possible?
  18. Create an image and then create a button in front of image and on for example "K" hide it or show it
  19. So can you show me an example how I can create a button in front of this image and then hide it with it.
  20. Hello guys. I need to create a button in front of my created image and on button K (for example) I need to hide the image and the button (and also cursor,but i did it). So,I can hide cursor and an image but I can't hide the button idk why. Code: local x,y = guiGetScreenSize() local elementd = true local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function elementshowd () if elementd == false then elementd = true showCursor(false) guiSetVisible(event, false) else elementd = false end end bindKey( "K", "down", elementshowd) function eventshows () if elementd == false then showCursor ( true ) event = guiCreateButton(16, 20, 250, 40, "Take", false) addEventHandler ( "onClientGUIClick", event, Tokens ) --------- dxDrawImage(500*sW, 120*sH, 370*sW, 470*sH, "img/event.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end addEventHandler ( "onClientRender", getRootElement(), eventshows ) Help me please to hide the button
  21. 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
  22. Now it works perfectly!Thanks a lot
×
×
  • Create New...