Search the Community
Showing results for tags 'help me!'.
-
So I'm trying to do an inventory script and I'm having a problem with the dxTarget scaling. https://youtu.be/rCihMvRlvBs local screenW, screenH = guiGetScreenSize() local render = dxCreateRenderTarget(screenW * 0.3994, screenH * 0.2652) local cx, cy = (screenW/2) - ((screenW * 0.3994) / 2), (screenH/2) - ((screenH * 0.2652) / 2) local scroll = 0.0000 local scrollV = 0.0255 local maxScroll = 0.0000 local selected = 47 local slots = {} local Color = tocolor(140, 140, 140, 150) local selectedColor = tocolor(0, 200, 255, 200) function dxInv() if render and isElement(render) then showCursor(true) dxDrawRoundedRectangle(screenW * 0.3994, screenH * 0.2652, screenW * 0.2012, screenH * 0.4697, 10, tocolor(0, 0, 0, 80), false) x, y = 0.0050, 0.0040 local load = getElementData(localPlayer, 'inv.mochila') slots = {} dxSetRenderTarget(render, true) for i=1,24 do dxDrawRectangle(screenW * x, screenH * (y - scroll), screenW * 0.0920, screenH * 0.0470, i == selected and selectedColor or Color, false) table.insert(slots, {screenW * x, screenH * (y - scroll), screenW * 0.0920, screenH * 0.0470}) dxDrawImage(screenW * (x + 0.0100), screenH * ((y + 0.0070) - scroll), screenW * 0.0700, screenH * 0.0350, "img/agua.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) x = x + 0.0990 if x >= 0.3850 then x = 0.0050 y = y + 0.0495 end end maxScroll = y - 0.2152 dxSetRenderTarget() dxDrawImage(screenW * 0.3994, screenH * 0.2652, screenW * 0.2012, screenH * 0.4697, render) end end addEventHandler('onClientRender', root, dxInv) function scrollRoller(b, p) if p then if b == 'mouse_wheel_up' then scroll = math.max(0, scroll - scrollV) elseif b == 'mouse_wheel_down' then scroll = math.min(maxScroll, scroll + scrollV) end end end addEventHandler('onClientKey', root, scrollRoller) function clickSelect(b, s) if s == 'down' then if b == 'left' then for i,v in ipairs(slots) do if isMouseInPosition(v[1] + cy, v[2] + cx, v[3], v[4]) then selected = i end end end end end addEventHandler('onClientClick', root, clickSelect)
- 2 replies
-
- help me!
- script help support
-
(and 2 more)
Tagged with:
-
local x,y,z,lx,ly,lz = getCameraMatrix() addCommandHandler("getmatrixcam", function() outputChatBox("your position is:" ..x,y,z,lx,ly,lz.. ".") end) Does anyone know what the problem is with this code? (I am using the translator). I'm new to scripting... ERRO: Bad argument @'outputChatBox' [expected bool at argument 5, got number '-1710.618...']
-
I don't know what the problem is with the script addEventHandler ("onPlayerCommand", getRootElement(), function (cmd ) local serial = getPlayerSerial ( source ) if not (devSerials[serial] ) then if (devCommands[cmd]) then outputChatBox (exports.fv_engine:getServerSyntax("Admin","red").."Ezt a parancsot nem használhatod!",source,255,255,255,true); cancelEvent(); end end if devSerials[serial] then if (devCommands[cmd]) then sendMessageToAdmin(source, hexColor..getAdminName(source)..white.." használta a(z) "..hexColor..cmd..white.." parancsot!", 5); exports['fv_logs']:createLog(cmd, getAdminName(source).." használta a(z) " ..cmd.." parancsot!",source); end end end);
-
Hello I need help... I reinstalled the Mta-Sa Client. But he still saves Resouce where the first client was. How can I change it? PLS HELP ME..