Jump to content

AngelAlpha

Members
  • Posts

    172
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by AngelAlpha

  1. По поводу перехода в другой город, можно как ты предложил через бд (мускул). А по поводу звонков, вроде никак. Потому что звонки реализованы по типу войс чата где друг друга слышать только 2 игрока
  2. replacer engineRemoveShaderFromWorldTexture > engineApplyShaderToWorldTexture
  3. local sx, sy = guiGetScreenSize() exports.blur_box:createBlurBox( 0, 0, sx, sy, 255, 255, 255, 255, false )
  4. function wasNickChangedByUser(_, _, byUser) if byUser then cancelEvent() end end addEventHandler("onPlayerChangeNick", root, wasNickChangedByUser)
  5. добавить проверку в радар по типу if not getElementData(localPlayer, "is_login") then return end и в логин панель при авторизации setElementData(игрок, "is_login", true)
  6. host должен быть не IP сервер, а IP базы данных порт для подключения не нужен, нужен только логин и пароль
  7. AngelAlpha

    File

    <meta> <script src="config.lua" type="shared" cache="false" validate="false"/> <script src="client.lua" type="client" cache="false" validate="false"/> <script src="server.lua" type="server" cache="false" validate="false"/> </meta>
  8. replace local Inv1 = convert(getElementData(localPlayer, "Inventário:Slots") or 0) or "0" local Inv2 = convert(getElementData(localPlayer, "Inventário:Max") or 0) or "0" local Inv3 = convert(getElementData(objbau, "Bau:Slots") or 0) or 0 local Inv4 = convert(getElementData(objbau, "Bau:Max") or 0) or 0 ---------------------------------------------------------------------------------------- function convert ( number ) return tonumber(string.format("%.1f", format(number)) end
  9. the error is not in the syntax, but in the fact that there is no number
  10. in the one-resource add to meta <export function="firstFunction" type="server"/> <!-- if function on server side --> <export function="firstFunction" type="client"/> <!-- if function on client side --> <export function="firstFunction" type="shared"/> <!-- if function can used on server and client side --> and in two-resource use exports["one-resource"]:firstFunction( [args] ) -- or exports.one-resource:firstFunction( [args] )
  11. local sx, sy = guiGetScreenSize() local relx,rely = sx/1920,sy/1080; local DutyPanel = false local MenuPoints = {00.35 ,00.20} color1 = tocolor(30, 40, 50, 255) addEventHandler("onClientRender", root, function() if (DutyPanel) then if not (getElementData(localPlayer, "Duty")) then dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty Felvétel", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) else dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty leadása", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) end ---------- if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then color1 = tocolor(80, 90, 100, 255) else color1 = tocolor(30, 40, 50, 255) end end end) addEventHandler("onClientClick", root, function(button, state) if (DutyPanel) then if ( button == "left" and state == "down" ) then if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then triggerServerEvent("Dutyon", root) DutyPanel = false end end end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end addEvent("OpenDutyPanel", true) addEventHandler("OpenDutyPanel", root, function() if not (DutyPanel) then DutyPanel = true else outputChatBox("#961f17[RENDSZER]: #ffffffMár menűbe vagy!", 0, 0, 0, true) end end) function ShowCursor() if not isCursorShowing() then showCursor(true) else showCursor(false) end end bindKey("m", "Down", ShowCursor) try this code
  12. check it [lobby] | Multi Theft Auto | Community
  13. addEventHandler ("onPlayerLogin", root, function(_, acc) setAccountData(acc, "lastlogin:timestamp", getRealTime().timestamp) end) addEventHandler ("onResourceStart", resourceRoot, function() for i, v in ipairs (getAccounts()) do if not getAccountData (v, "lastlogin:timestamp") then setAccountData(acc, "lastlogin:timestamp", getRealTime().timestamp) end end end) ------------------------- addEventHandler ("onPlayerLogin", root, function(_, acc) local timestamp = getAccountData(acc, "lastlogin:timestamp") local time = getRealTime(timestamp) local day = time.monthday local month = time.month + 1 local year = time.year + 1900 local id = getElementData(source, "your ID data") or "N/A" outputDebugString ("person ID "..id.." logs in "..day.." "..month..", "..year) end)
  14. AngelAlpha

    [HELP]

    local models = { 411, 478, 240 -- add as many models here as you want, and the code will work without any other changes } local displayVehicle, index -- declaring variables as local ahead of time allows to get the speed benefits of `local` while having variables accessible thoughout the current script file (not accessible in other scripts of the same resource though) local function updateDisplayVehicle() if (isElement(displayVehicle)) then -- to prevent generating errors when the vehicle doesn't exist destroyElement(displayVehicle) -- delete the existing vehicle if it exists end local vehModel = models[index] -- get the vehicle model corresponding to the current index displayVehicle = createVehicle(vehModel, 2154.45996, -1153.21362, 23.87550) -- spawns a vehicle with the correct vehicle model end updateDisplayVehicle() local function tryChangeIndex(newIndex) if not models[newIndex] then if newIndex < 1 then newIndex = #models else newIndex = 1 end end index = newIndex updateDisplayVehicle() end local function nextVehicle() tryChangeIndex(index + 1) end bindKey("arrow_r", "down", nextVehicle) local function previousVehicle() tryChangeIndex(index - 1) end bindKey("arrow_l", "down", previousVehicle)
  15. my code will only work with vehicles that have been created in this resource show pls all your code
  16. client.lua addEventHandler("onClientVehicleExit", resourceRoot, function(player, seat) if (player == localPlayer) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then if (vehicle == getElementData(localPlayer, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", 0, 0, 0, true) end end end end end ) meta.xml <meta> <script src="client.lua" type="client"/> </meta>
  17. нет, проблема была в условиях, пересмотри свою версию и мою
  18. Я точно не уверен, но вроде так function kek() showCursor(true) dgs:dgsSetVisible(window,true) dgs:dgsSetVisible(imgposition1,true) dgs:dgsSetVisible(imgposition2,true) end function kek1() dgs:dgsSetVisible(window,false) dgs:dgsSetVisible(imgposition1,false) dgs:dgsSetVisible(imgposition2,false) end bindKey('1','down',kek) addEventHandler('onDgsMouseClick',root,function(btn,state) ----------------Армия ------------------- if state == "down" and btn == "left" and source == btnArmy then kek1() triggerEvent("PedCreate",localPlayer) showCursor(true) dgs:dgsSetVisible(but1,true) dgs:dgsSetVisible(but2,true) dgs:dgsSetVisible(but3,true) si = 1 if not si == 1 then si = 1 end skinid1 = 179 setCameraMatrix(247.96488952637,1861.4558105469,14.794466018677,248.35562133789,1764.9252929688,-11.315200805664) elseif state == "down" and btn == "left" and source == but1 then si = si - 1 if si == 0 then si = 5 end elseif state == "down" and btn == "left" and source == but2 then dgs:dgsSetVisible(but1,false) dgs:dgsSetVisible(but2,false) dgs:dgsSetVisible(but3,false) setElementData(localPlayer,"skinid1",skinid1) triggerServerEvent("spawnPlayerArmy",localPlayer) setCameraTarget( localPlayer ) showCursor(false) triggerEvent("PedDel",localPlayer) elseif state == "down" and btn == "left" and source == but3 then si = si + 1 if si == 6 then si = 1 end if si == 1 then skinid1 = 179 setCameraMatrix(247.96488952637,1861.4558105469,14.794466018677,248.35562133789,1764.9252929688,-11.315200805664) elseif si == 2 then skinid1 = 285 setCameraMatrix(246.00991821289,1861.4471435547,14.794466018677,246.40065002441,1764.9166259766,-11.315200805664) elseif si == 3 then skinid1 = 287 setCameraMatrix(243.98690795898,1861.4406738281,14.794466018677,244.37763977051,1764.91015625,-11.315200805664) elseif si == 4 then skinid1 = 73 setCameraMatrix(241.95097351074,1861.4321289063,14.794466018677,242.34170532227,1764.9016113281,-11.315200805664) elseif si == 5 then skinid1 = 191 setCameraMatrix(239.9241027832,1861.4228515625,14.794466018677,240.31483459473,1764.8923339844,-11.315200805664) end -------------Террористы ------------- elseif state == "down" and btn == "left" and source == btnTerr then kek1() showCursor(true) dgs:dgsSetVisible(but4,true) dgs:dgsSetVisible(but5,true) dgs:dgsSetVisible(but6,true) ti = 1 if not ti == 1 then ti = 1 end triggerEvent("PedCreateTerr",localPlayer) skinid1 = 28 setCameraMatrix(-274.44561767578,2588.4030761719,64.03636932373,-276.62969970703,2686.3229980469,43.863948822021) elseif state == "down" and btn == "left" and source == but4 then ti = ti - 1 if ti == 0 then ti = 5 end elseif state == "down" and btn == "left" and source == but5 then dgs:dgsSetVisible(but4,false) dgs:dgsSetVisible(but5,false) dgs:dgsSetVisible(but6,false) setElementData(localPlayer,"skinid1",skinid1) triggerServerEvent("spawnPlayerTerr",localPlayer) setCameraTarget( localPlayer ) showCursor(false) triggerEvent("PedDelTerr",localPlayer) elseif state == "down" and btn == "left" and source == but6 then ti = ti + 1 if ti == 6 then ti = 1 end if ti == 1 then skinid1 = 28 setCameraMatrix(-274.44561767578,2588.4030761719,64.03636932373,-276.62969970703,2686.3229980469,43.863948822021) elseif ti == 2 then skinid1 = 30 setCameraMatrix(-272.44989013672,2588.4465332031,64.03636932373,-274.63397216797,2686.3664550781,43.863948822021) elseif ti == 3 then skinid1 = 126 setCameraMatrix(-270.45120239258,2588.4909667969,64.03636932373,-272.63528442383,2686.4108886719,43.863948822021) elseif ti == 4 then skinid1 = 93 setCameraMatrix(-268.44940185547,2588.5341796875,64.03636932373,-270.63348388672,2686.4541015625,43.863948822021) elseif ti == 5 then skinid1 = 150 setCameraMatrix(-266.46176147461,2588.5773925781,64.03636932373,-268.64584350586,2686.4973144531,43.863948822021) elseif ti == 6 then ti = ti - 1 end end end) Просто если бы ты написал в чем именно проблема, было бы легче понять что не так
  19. local marker = createMarker (...) addEventHandler ("onMarkerHit", marker, function(el, dim) if not dim then return end if getElementType(el) ~= "player" then return end local veh = getPedOccupiedVehicle (el) if veh then if getVehicleOccupant(veh) ~= el then return end setElementPosition (veh, x, y, z) else setElementPosition (el, x, y, z) end end)
×
×
  • Create New...