Jump to content

Mr.Loki

Members
  • Posts

    667
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Mr.Loki

  1. For it to rotate you need to use the lookAt args and and use sine and cosine to rotate around the x and y. Also the way u calculated the size made the image oval and i fixed that. local size = 3 local img = point(500,-1) local rot = 0 function createIMG() local x,y,z = local rx = math.sin(rot)*1 local ry = math.cos(rot)*1 dxDrawMaterialLine3D( x, y, z, x, y, z+size, img, size, -1, x+rx, y+ry, z ) rot = rot +.01 end addEventHandler("onClientRender", root, createIMG)
  2. Mr.Loki

    Timer

    Store the timer in a table for each player for example Table[player]= Timer(function ()end,3000,1) And to check you simply do if isTimer(Table[player]) then Output you deny message else Let them in end
  3. That's because there are other domains that the site uses for resources like media. Use this event to capture all of them that were blocked and store them in a table somewhere Then requestBrowserDomains of that table with the blocked domains You may need to refresh and repeat before all domains can be unblocked so save them somewhere and when someone tries to go to that site in the server use the request domains function and send a table of all the domains that should be whitelisted.
  4. Yeah you can but you'd need to whitelist a bunch of domains that the site uses.
  5. You will need to use triggerServerEvent and create the vehicle on the server then you can use warpPedIntoVehicle to teleport the player instantly into the vehicle on creation.
  6. You need to add the dxVisible var to your clicking event so it only executes if dxVisible is true. Like this: function onClick(button, state) if dxVisible and (button == "left") and (state == "up") then -- check if dx-rectangle is showing here if isMouseInPosition( 490, 284, 116, 47 ) then outputChatBox ( "Машина заспавнена!" ) --car spawn createVehicle(434,x,y,z) y = y + 5 elseif isMouseInPosition( 737, 284, 116, 47 ) then outputChatBox ( "Вы сменили скин!" ) --skin change setElementModel ( player, 25) end end end addEventHandler( "onClientClick", root, onClick )
  7. Why are you checking if the localPlayer is the localPlayer ._. localPlayer can only be localPlayer ._______. Are you getting any errors in the debug when you restart the script? /debugscript 3
  8. Mr.Loki

    Help me

    The function dxDrawImage3D is a Useful/Custom function meaning you need to add this function to your code for it to work. Also use the code button <> when posting code. local white = tocolor(255,255,255,255) function dxDrawImage3D(x,y,z,w,h,m,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c or white, ...) end local face = dxCreateTexture("weed.png") addEventHandler("onClientRender", root, function() dxDrawImage3D(-2410.76001, -600.35828, 132.64066, face, tocloro(255,255,255,255)) end )
  9. Without more info/code we can't help you...
  10. local screenW,screenH = guiGetScreenSize( ) -- get the player's screen resolution local INVopen function inventarioV() local ammo = tostring(getPedTotalAmmo(localPlayer) - getPedAmmoInClip(localPlayer)) local ammoinclip = tostring(getPedAmmoInClip(localPlayer)) local id = tostring(getPedWeapon( localPlayer )) local id2 = getPedWeapon( localPlayer ) local im = getWeaponNameFromID(getPedWeapon(localPlayer)) -- Imagenes dxDrawImage(screenW * 0.8779, screenH * 0.1380, screenW * 0.0029, screenH * 0.0169, ":Inventario/images/bullet.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.4081, screenH * 0.1094, screenW * 0.1838, screenH * 0.7813, ":Inventario/images/character.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.6963, screenH * 0.1719, screenW * 0.2110, screenH * 0.1055, ":Inventario/Inventory/"..id..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, tocolor(0, 0, 0, 165), false) dxDrawText(":Onacio", screenW * 0.4015, screenH * 0.0260, screenW * 0.5985, screenH * 0.0612, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(932 - 1, 102 - 1, 932 - 1, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 102 - 1, 932 - 1, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(932 - 1, 122, 952, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 122, 952, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawRectangle(932, 102, 20, 20, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.1771, screenW * 0.6390, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.1771, screenW * 0.6390, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1250, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.2422, screenW * 0.6390, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.2422, screenW * 0.6390, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1901, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawText(""..im, screenW * 0.7037, screenH * 0.1328, screenW * 0.8279, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "default-bold", "left", "bottom", false, false, false, false, false) dxDrawText(""..ammoinclip, screenW * 0.8529, screenH * 0.1328, screenW * 0.8765, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "clear", "right", "bottom", false, false, false, false, false) dxDrawText(""..ammo, screenW * 0.8824, screenH * 0.1315, screenW * 0.9044, screenH * 0.1576, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "bottom", false, false, false, false, false) dxDrawLine(screenW * 0.6831, screenH * 0.3073, screenW * 0.9316, screenH * 0.3073, tocolor(255, 255, 255, 255), 1, false) dxDrawText("1", 932, 102, 952, 122, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.3971, screenW * 0.6390, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.3971, screenW * 0.6390, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.3451, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.4622, screenW * 0.6390, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.4622, screenW * 0.6390, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4102, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.5273, screenW * 0.6390, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.5273, screenW * 0.6390, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4753, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.6823, screenW * 0.6390, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.6823, screenW * 0.6390, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6302, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.7474, screenW * 0.6390, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.7474, screenW * 0.6390, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6953, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 140), false) end bindKey ("TAB", "down", function( ) if not INVopen then -- check if the window is open addEventHandler( "onClientRender", root, inventarioV ) -- open the window if it is not showing by adding the render event to the function. else removeEventHandler( "onClientRender", root, inventarioV ) -- close the window if it is showing by removing the render event from the function. end INVopen = not INVopen -- Toggle the variable that declares if the window is open or not switching it to true/false end)
  11. I don't see a "components" table in your code anywhere and I also don't see any "alto" vehicle component in the vehicle components list ._. https://wiki.multitheftauto.com/wiki/Vehicle_Components
  12. @Viudes that community resource helps you create GUI quick and easy to use. I personally use it all the time. It does not pre-script any functions for you and it's much better than guessing positions for GUI elements. It also somewhat helps with scaling for different resolutions. When you use the GUI editor and create your GUI, you can output the code for it and use it in your resource. It most definitely will not hinder you from learning about scripting. Give it a shot, never know what you might learn from it.
  13. You will need to create a table for each player containing the inv items and store it somewhere for example element data and loop that table instead of the newInvItems
  14. Read the syntax to know how to use the function.
  15. It does exactly that lol Did u read the page?
  16. With the link i sent above. You can click the word.
  17. road1 = createObject ( 1780, 171.085, -217.559, 1200.0, 0, 0, 0 ) lod_road1 = createObject ( 1674, 171.085, -217.559, 1200.0, 0, 0, 0, true ) setLowLODElement ( road1,lod_road1 )
  18. If you didn't kno there's a search function on the wiki. setElementDoubleSided
  19. Try this function erablas( button, state, thePlayer ) if button == "left" and state == "down" then if getElementType( source ) == "object" and getElementModel(source) == 1829 then local x, y, z = getElementPosition( thePlayer ) local x1, y1, z1 = getElementPosition( source ) local distance = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ) if distance < 4 then if ( idozito [ source ] ~= nil ) then outputChatBox ( "#01AC41[SuperFun] #FFffFFA következő széfrablásig várnod kell #01AC41".. math.floor ( getTimerDetails ( idozito [ thePlayer ] ) / 60000+1 ) .." percet.", thePlayer, 255, 0, 0, true ); else setElementFrozen(thePlayer, true) setPedAnimation(thePlayer , "rob_bank", "cat_safe_rob", 10000, true, true, true, false) setTimer(setElementFrozen,10000,1,thePlayer,false) setTimer(setPedAnimation,10000,1,thePlayer) randomM = math.random(500000,1500000) setTimer(function() givePlayerMoney(thePlayer,randomM) destroyElement(safe) end,10000,1) setTimer(outputChatBox, 10000,1,"#01AC41[SuperFun] #FFffFFÖsszesen raboltál #01AC41"..randomM.." #ffffffforintot.",thePlayer,255,255,255,true) setTimer(outputChatBox, 900000, 1,"#01AC41[SuperFun - #8C8C8CÉszaki] #FFffFFAz #01AC41északin #FFffFFújra kirabolhatóvá vált a széf! #01AC41(/eszaki)",root,255,255,255,true) setTimer(Boltrablas,900000,1) idozito [ source ] = setTimer ( function ( ) idozito [ source ] = nil; end, 900000, 1, source); end else outputChatBox ( "#01AC41[SuperFun] #FFffFFTúl messze vagy a széftől! Gyere közelebb, nem harap..", thePlayer, 255, 0, 0, true ); end end end end addEventHandler( "onElementClicked", getRootElement( ), erablas )
  20. You needed to loop the click function for all the buttons. function inventoryClickDetect (button,state,x,y) for i=1,rowNumber do if ( button == "left" ) then if ( state == "down" ) then if ( x >= 210 and x <= 210 + 50 and y >= 85+i*20 and y <= 85+i*20 + 15 ) then outputChatBox("Took "..newInvItems[i][1]) return end end end end end addEventHandler("onClientClick",root,inventoryClickDetect)
  21. Insert the source into your idozito table instead of thePlayer.
  22. You will need to constrain the x and y position of the blip to the width and height of the map. Here's a simple constrain function that will lock those values for you: local max,min = math.min,math.max function cstrain( value, v1, v2 ) return max(min(value,v1),v2) end Example: local blipX = -900 local blipY = 99 local x = cstrain(blipX,50,200) local y = cstrain(blipY,300,200) iprint("x="..x,"y="..y) -- output: -- x=50 -- y=99
×
×
  • Create New...