Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 22/12/20 in all areas

  1. local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ local hudElements = {} function _dxDrawImage(x,y,w,h,image,rot,rotOffsetX,rotOffsetY,color,postgui) local btn = guiCreateButton(x,y,w,h,"",false) if btn then setElementData(btn,"hudElement",true) guiSetAlpha(btn,0) table.insert(hudElements,{element=btn,type='image',dx={}}) hudElements[#hudElements].dx[1] = x hudElements[#hudElements].dx[2] = y hudElements[#hudElements].dx[3] = w hudElements[#hudElements].dx[4] = h hudElements[#hudElements].dx[5] = image hudElements[#hudElements].dx[6] = tonumber(rot) or 0 hudElements[#hudElements].dx[7] = tonumber(rotOffsetX) or 0 hudElements[#hudElements].dx[8] = tonumber(rotOffsetY) or 0 hudElements[#hudElements].dx[9] = tonumber(color) or tocolor(255,255,255,255) hudElements[#hudElements].dx[10] = ( postgui == true ) or false return true end end function _dxDrawRectangle(x,y,w,h,color,postgui) local btn = guiCreateButton(x,y,w,h,"",false) if btn then setElementData(btn,"hudElement",true) guiSetAlpha(btn,0) table.insert(hudElements,{element=btn,type='rectangle',dx={}}) hudElements[#hudElements].dx[1] = x hudElements[#hudElements].dx[2] = y hudElements[#hudElements].dx[3] = w hudElements[#hudElements].dx[4] = h hudElements[#hudElements].dx[5] = tonumber(color) or tocolor(255,255,255,255) hudElements[#hudElements].dx[6] = ( postgui == true ) or false return true end end addEventHandler('onClientRender',root, function() for i,v in ipairs(hudElements) do if targetElement and targetElement == v.element then if getKeyState("mouse1") ~= true then targetElement = nil end if isCursorShowing() == true then local positionX, positionY, worldX, worldY, worldZ = getCursorPosition() local screenx, screeny = getScreenFromWorldPosition(worldX,worldY,worldZ) if screenx and screenx < sx__ and screeny < sy__ then v.dx[1],v.dx[2] = screenx,screeny end guiSetPosition(v.element,v.dx[1],v.dx[2],false) else targetElement = false end end if v.type == 'rectangle' then dxDrawRectangle( v.dx[1], v.dx[2], v.dx[3], v.dx[4],v.dx[5], v.dx[6]) elseif v.type == 'image' then dxDrawImage( v.dx[1], v.dx[2], v.dx[3], v.dx[4],v.dx[5], v.dx[6], v.dx[7], v.dx[8], v.dx[9], v.dx[10] ) end end end ) addEventHandler("onClientGUIMouseDown",resourceRoot, function(btn) if btn == "left" then if getElementData(source,"hudElement") == true then targetElement = source end end end ) bindKey("m","down",function() if isCursorShowing() then showCursor(false) else showCursor(true) end end) _dxDrawRectangle( (sx_-245) * xm, (sy_/2-460) * ym, 220 * xm, 10 * ym,tocolor(0,0,0,120),true) Made you this real quick so you have an idea of what to do, it's not all perfect at the moment but it's something you could use as a start. It's much simpler than you attempting to calculate for every single thing you'd want to draw. You can use what you have there to help you with doing the texts, good luck.
    1 point
  2. You can't use the new IDs on server-side yet you need to use setElementModel on client-side
    1 point
  3. --/> Client-Side local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 960 local x, y = (screenW/resW), (screenH/resH) local painel = false function dx_Painel () if painel == true then dxDrawRectangle(x*358, y*144, x*631, y*420, tocolor(0, 0, 0, 197), false) dxDrawRectangle(x*358, y*144, x*631, y*47, tocolor(0, 0, 0, 203), false) dxDrawText("Divinity Police",x*519, y*145, x*833, y*191, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false) dxDrawRectangle(x*358, y*243, x*632, y*58, tocolor(61, 61, 61, 203), false) dxDrawRectangle(x*358, y*347, x*632, y*58, tocolor(61, 61, 61, 203), false) dxDrawRectangle(x*358, y*438, x*632, y*58, tocolor(61, 61, 61, 203), false) dxDrawText("Pegar equipamentos", x*518, y*253, x*832, y*299, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Guardar equipamentos", x*515, y*357, x*829, y*403, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Pegar viatura", x*515, y*448, x*829, y*494, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("X", x*915, y*153, x*961, y*185, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, false, false, false) end end function abrir_painel () if painel == false then addEventHandler("onClientRender", getRootElement(), dx_Painel) painel = true end end addEvent("Event:Abrir_Painel_Police", true) addEventHandler("Event:Abrir_Painel_Police", getRootElement(), abrir_painel) function fechar_painel () --/> Fechar o Painel / Não Esta Funcional é um Exemplo, Precisará Implementa no seu Script. if painel == true then painel = false removeEventHandler("onClientRender", getRootElement(), dx_Painel) end end --/> Server-Side local marker = createMarker (1539.21252, -1647.53589, 4.89063, "cylinder", 1.5 ,50,100,100) function abrir_painel (hitElement) if getElementType(hitElement) == "player" then triggerClientEvent(hitElement, "Event:Abrir_Painel_Police", hitElement) end end addEventHandler("onMarkerHit", marker, abrir_painel)
    1 point
  4. hmm... maybe server-side script: function warptheped(player) vehicle = getPedOccupiedVehicle(player) triggerClientEvent ("onDefaultInf", player) warpPedIntoVehicle ( player, vehicle) end addCommandHandler ("noinfernus", warptheped) client side script: addEvent ( "onDefaultInf", true ) function destroymodels() engineRestoreModel ( 411 ) end addEventHandler ("onDefaultInf", getLocalPlayer(), destroymodels) Its a client and server side event, because when you replace infernus DFF, and player is in it, player will get out, so this script makes the player get out and in. This will just restore old DFF, for destroy TXD do destroyElement ( TXD Element ) for example: txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) for restore that, I don't have to put destroyElement ( 3781 ) obviously, not. Wrong: function floor() txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) end addEventHandler ("onClientResourceStart", resourceRoot, floor) function destroyfloor() destroyElement ( 3781 ) end addCommandHandler ("nofloor", destroyfloor) Good: function floor() txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) end addEventHandler ("onClientResourceStart", resourceRoot, floor) function destroyfloor() destroyElement ( txd_floors ) end addCommandHandler ("nofloor", destroyfloor) This destroy function is not destroying an ID, its destroying the TXD element. Btw, the real infernus TXD is just 300 kb.
    1 point
  5. The usual response would be: Temporary bans can't be appealed, and you can imagine the excuse you wrote down is usually not true (lied) which is why we can't accept that. But in this case, as I heard that you're being disruptive and already had to get banned from the MTA discord as a result of your behavior regarding this ban, I decided to check and found out that: - You have been using this exact same lagswitch for the entire past week - The last time you ran this lagswitch, it broke up your routine because a few days ago, we not only added detection for more lagswitches, but also made the anti-cheat start banning for most of them instead of just kicking. This was done to reduce people testing a lot of individual lagswitches to see which one works (doesn't result in a kick), as obviously lag switches must be individually detected as lag can be caused by many innocent system factors and events. That means it's not realistically possible for us to detect all of them. So then, people will suffer pain for this practise, besides getting punished for actively using lagswitches that can all of a sudden become individually detected the next day. The latter is what happened to you. After using a certain lagswitch contantly (yes, you lied.. please get outta here now), your lagswitch became detected and this resulted in your temporary ban. All lagswitch users therefore risk being banned for 1 day, so that's also a nice warning to go out towards anyone who thinks they are safe using a lagswitch that still works - it can suddenly change. @District76 nice try though
    0 points
  6. It does not work correctly! When playing a video, a window pops up asking "do I want to play the video" and I "press yes" and the video starts, but not on the big screen, but in the window.
    0 points
×
×
  • Create New...