-
Posts
1,134 -
Joined
-
Last visited
-
Days Won
37
Everything posted by NeXuS™
-
Did you save the player's password into an account data?
-
Replace local experiencia = getAccountData(account, "ip") with local experiencia = getPlayerIP(sourcePlayer)
-
Did you select the "Lua" language in your language selection?
-
Can you upload that one TXD somewhere, so we can take a look at it?
-
local guiWindow = guiCreateWindow(500, 200, 500, 300, "Test panel", false) local scrollPane = guiCreateScrollPane(0, 20, 500, 300, false, guiWindow) local things = { {"Test Test Test Test", "text"}, {"Test2 Test2 Test2 Test2", "text"}, {"Test3 Test3 Test3 Test3", "text"}, {"Test4 Test4 Test4 Test4", "text"} } function drawThings() local x, y = 0, 0 local nextY = 0 for i, k in ipairs(things) do if k[2] == "text" then if x + dxGetTextWidth(k[1]) > 500 then x = 0 y = nextY end guiCreateLabel(x, y, dxGetTextWidth(k[1]), 15, k[1], false, scrollPane) if nextY < y + 15 then nextY = nextY + 15 end x = x + dxGetTextWidth(k[1]) + 10 elseif k[2] == "image" then if x + k[3] > 500 then x = 0 y = nextY end guiCreateStaticImage(x, y, k[3], k[4], k[1], false, scrollPane) if nextY < y + k[4] then nextY = y + k[4] end x = x + k[3] + 10 end end end drawThings() This one is tested with texts, and worked. Can ya test it with pictures?
-
You should just calculate the X and Y positions of the elements. local scrollPane = guiCreateScrollPane(500, 200, 500, 300, false) local things = { {"Test Test Test Test", "text"}, {"test.png", "image", 100, 50} } function drawThings() local x, y = 0, 0 local nextY = 0 for i, k in ipairs(things) do if k[2] == "text" then if x + dxGetTextWidth(k[1]) > 300 then x = 0 y = nextY end guiCreateLabel(x, y, dxGetTextWidth(k[1]), 15, false, scrollPane) if nextY < y + 15 then nextY = nextY + 15 end elseif k[2] == "image" then if x + k[3] > 300 then x = 0 y = nextY end guiCreateStaticImage(x, y, k[3], k[4], k[1], false, scrollPane) if nextY < y + k[4] then nextY = y + k[4] end end end end Should work, not tested tho.
-
Try sending out the datas to the chat?
-
Maybe try creating a new object with the same ID at the exact same position and set that object to the LowLODElement?
-
Set your type in your SQL Table to text.
-
Download these files: http://indabox.hu/utUn63 http://indabox.hu/CJ8bx2 And put them in \Notepad++\plugins\APIs.
-
addEventHandler dxDrawText table.insert And I don't think you'll need more than that.
-
local renderTarget = dxCreateRenderTarget(500, 15) local scrollerW, scrollerH = 20, 3.75 -- scrollerH = Rectangle height / Line count local fullScrolled = 45 -- (Line count - 1) * dxGetFontHeight(currentSize, currentFont) local fullSize = 60 -- Line count * dxGetFontHeight(currentSize, currentFont) local moveY = 0 -- Default offset of Y position local multiLine = [[This is a multiple line text. 2nd line 3rd line 4th line]] function dxDraws() dxDrawRectangle(500, 200, 200, 15, tocolor(0, 0, 0, 255)) dxSetRenderTarget(renderTarget, true) dxDrawText(multiLine, 0, moveY, 500, 15, tocolor(255, 255, 255, 255), 1) dxSetRenderTarget() dxDrawImage(500, 200, 500, 15, renderTarget) local scrollerPercentage = (-moveY)/fullSize dxDrawRectangle(500-scrollerW, 200+scrollerPercentage*15, scrollerW, scrollerH, tocolor(128, 128, 0, 255)) end addEventHandler("onClientRender", getRootElement(), dxDraws) addEventHandler("onClientKey", getRootElement(), function(cK, cS) if cS then if cK == "mouse_wheel_up" then outputChatBox(moveY) if moveY < 0 then moveY = moveY + 1 end elseif cK == "mouse_wheel_down" then if moveY > -fullScrolled then -- Added an if statement, so it cannot be scrolled more than it should be. moveY = moveY - 1 end end end end)
-
We won't make a whole resource here for you, we'll help you, if you are stuck somewhere. But you didn't even start your work.
-
You'll have to write a outputToAdmins function for just easier overview. function outputToAdmins(source, commandName) for i, k in ipairs(getElementsByType("player")) do -- Get all the online players if (getElementData(k, "adminlevel") or 0) > 0 then -- Check if he is admin (Replace this line with your admin-system's level, we don't know what you are using.) outputChatBox(getPlayerName(source) .. " used the " .. commandName .. " command.", k, 255, 255, 255) -- Outputting that the player used the command to the chat end end end If this is done, you'll have to go through each command you want to be logged, and call the function with the player at arg. 1 and the command's name in arg 2.
-
Do you mean if an admin types in /jail or /givemoney or etc. then output it to all online admins?
-
Replace function checkPickup() if getKeyState( "l" ) == false then cancelEvent( onPickupUse ) else end end with function checkPickup() if getKeyState("l") == false then cancelEvent() end end
-
Gonna check, give me a minute. local renderTarget = dxCreateRenderTarget(500, 15) local scrollerW, scrollerH = 20, 3.75 -- scrollerH = Rectangle height / Line count local fullScrolled = 45 -- (Line count - 1) * dxGetFontHeight(currentSize, currentFont) local fullSize = 60 -- Line count * dxGetFontHeight(currentSize, currentFont) local moveY = 0 -- Default offset of Y position local multiLine = [[This is a multiple line text. 2nd line 3rd line 4th line]] function dxDraws() dxDrawRectangle(500, 200, 200, 15, tocolor(0, 0, 0, 255)) dxSetRenderTarget(renderTarget, true) dxDrawText(multiLine, 0, moveY, 500, 15, tocolor(255, 255, 255, 255), 1) dxSetRenderTarget() dxDrawImage(500, 200, 500, 15, renderTarget) local scrollerPercentage = (-moveY)/fullSize dxDrawRectangle(500-scrollerW, 200+scrollerPercentage*15, scrollerW, scrollerH, tocolor(128, 128, 0, 255)) end addEventHandler("onClientRender", getRootElement(), dxDraws) addEventHandler("onClientKey", getRootElement(), function(cK, cS) if cS then if cK == "mouse_wheel_up" then outputChatBox(moveY) if moveY < 0 then moveY = moveY + 1 end elseif cK == "mouse_wheel_down" then if moveY > -fullScrolled then -- Added an if statement, so it cannot be scrolled more than it should be. moveY = moveY - 1 end end end end) This one is tested, and works perfectly for me.
-
Is English your native language? Can you explain your problem a bit better?
-
They are useful @Gordon_G. For example, this script. It blocks the player from picking up a pickup, just with one line.
-
What's not working with it?
-
local renderTarget = dxCreateRenderTarget(500, 15) local scrollerW, scrollerH = 20, 3.75 -- scrollerH = Rectangle height / Line count local fullScrolled = 45 -- (Line count - 1) * dxGetFontHeight(currentSize, currentFont) local fullSize = 60 -- Line count * dxGetFontHeight(currentSize, currentFont) local mutliLine = [[This is a multiple line text. 2nd line 3rd line 4th line]] function dxDraws() dxDrawRectangle(500, 200, 200, 15, tocolor(0, 0, 0, 255)) dxSetRenderTarget(renderTarget) dxDrawText(multiLine, 0, moveY, 500, 15, tocolor(255, 255, 255, 255), 1, "default-bold") dxSetRenderTarget() dxDrawImage(500, 200, 200, 15, renderTarget) local scrollerPercentage = fullScrolled/fullSize dxDrawRectangle(500-scrollerW, 200+scrollerPercentage*15, scrollerW, scrollerH, tocolor(128, 128, 0, 255)) end addEventHandler("onClientKey", getRootElement(), function(cK, cS) if cS then if cK == "mouse_wheel_up" then outputChatBox(moveY) if moveY < 0 then moveY = moveY + 1 end elseif cK == "mouse_wheel_down" then if moveY > -fullScrolled then -- Added an if statement, so it cannot be scrolled more than it should be. moveY = moveY - 1 end end end end) I think this one should work, but again, not tested.
-
The window is already movable, and sizable. If you wish to, you can turn those off, by using dxWindowSetMovable and dxWindowSetSizable functions. And yes, DEV means it's WIP.