-
Posts
749 -
Joined
-
Last visited
-
Days Won
1
Everything posted by FlyingSpoon
-
addEventHandler("onClientRender", root, function() x = animate(0, 364, "Linear", 3000, nil) dxDrawRectangle(x, 183, 550, 380, tocolor(0, 0, 0, 156), false) dxDrawRectangle(364, 563, 550, 4, tocolor(237, 171, 123, 156), false) dxDrawRectangle(440, 295, 390, 37, tocolor(216, 213, 213, 254), false) dxDrawRectangle(440, 373, 390, 37, tocolor(216, 213, 213, 254), false) end ) Using this - https://wiki.multitheftauto.com/wiki/Animate It says, expected function at argument 5 got nil, does it have to be a function, all I want to do is move it left to right using this function. Update - Okay I've done something like this, it works but, the animation isn't completing, it just stops half way - addEventHandler("onClientRender", root, function() x = animate(0, 364, "Linear", 2000, function() end) dxDrawRectangle(x, 183, 550, 380, tocolor(0, 0, 0, 156), false) dxDrawRectangle(364, 563, 550, 4, tocolor(237, 171, 123, 156), false) dxDrawRectangle(440, 295, 390, 37, tocolor(216, 213, 213, 254), false) dxDrawRectangle(440, 373, 390, 37, tocolor(216, 213, 213, 254), false) end)
-
I get the example, so like - If it's like ipairs you can't do stuff like text = "text1" and for pairs you can do both. So would it be safer to just use pairs instead of ipairs then? Or is it that they both have different uses or something.
-
Thanks, just was wondering what you meant, but I understand it now kind of, so it sends data back and forth, in the triggers. I wanted to ask one last thing whats the different between ipairs and pairs? I mean last time I tried it they both outputted the same thing, so I was kind of confused.
-
I get that part, but how do I apply the certain rows and stuff to the client side script, like - -- CLIENT SIDE local screenW, screenH = guiGetScreenSize() function openTable(result) window = guiCreateWindow((screenW - 468) / 2, (screenH - 360) / 2, 468, 360, "Players", false) guiWindowSetSizable(window, false) gridlist = guiCreateGridList(19, 39, 426, 304, false, window) guiGridListAddColumn(gridlist, "ID", 0.2) guiGridListAddColumn(gridlist, "Name", 0.2) guiGridListAddColumn(gridlist, "Rank", 0.2) guiGridListAddColumn(gridlist, "IP Address", 0.2) guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, 0, 1, "-", false, false) guiGridListSetItemText(gridlist, 0, 2, "-", false, false) guiGridListSetItemText(gridlist, 0, 3, "-", false, false) guiGridListSetItemText(gridlist, 0, 4, "-", false, false showCursor(true) guiSetVisible(window, true) end addCommandHandler("open", openTable) How do I apply the different column's and data.
-
I know, but how would I actually move the data, that's what I'm asking you.
-
-- SERVER SIDE function generateTable() local query = dbQuery(connection, "SELECT * FROM players") local result = dbPoll(query, -1) if result then -- end end addEvent("gen:table", true) addEventHandler("gen:table", getRootElement(), generateTable) -- CLIENT SIDE local screenW, screenH = guiGetScreenSize() function openTable() window = guiCreateWindow((screenW - 468) / 2, (screenH - 360) / 2, 468, 360, "Players", false) guiWindowSetSizable(window, false) gridlist = guiCreateGridList(19, 39, 426, 304, false, window) guiGridListAddColumn(gridlist, "ID", 0.2) guiGridListAddColumn(gridlist, "Name", 0.2) guiGridListAddColumn(gridlist, "Rank", 0.2) guiGridListAddColumn(gridlist, "IP Address", 0.2) guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, 0, 1, "-", false, false) guiGridListSetItemText(gridlist, 0, 2, "-", false, false) guiGridListSetItemText(gridlist, 0, 3, "-", false, false) guiGridListSetItemText(gridlist, 0, 4, "-", false, false showCursor(true) guiSetVisible(window, true) end addCommandHandler("open", openTable) I know how to trigger it, but how would I take over the data onto the Client Side, via triggerServerEvent? And then set it to the Gridlist
-
Say for example, if I had a table that I wanted to get all possible data from so - local query = dbQuery( connection, "SELECT * FROM players" ) How would I put this into a grid list, client side, including the rows - ID, Name, Rank and IP.
-
How would I do that?
-
tinted.fx technique car_tint_window { pass P0 { DepthBias = 0.0000; AlphaBlendEnable = FALSE; SrcBlend = SRCALPHA; DestBlend = INVSRCALPHA; } } // fallback method technique fallback { pass P0 { // do normal drawing } } tinted.lua local theShader = dxCreateShader("tinted.fx", 1, 200, true) function tintedWindows() for k,vehicles in ipairs(getElementsByType("vehicle")) do if getElementData(vehicles, "tinted") == true then engineApplyShaderToWorldTexture(theShader, "vehiclegeneric256", vehicles) engineApplyShaderToWorldTexture(theShader, "hotdog92glass128", vehicles) engineApplyShaderToWorldTexture(theShader, "okoshko", vehicles) else engineRemoveShaderFromWorldTexture(theShader, "vehiclegeneric256", vehicles) engineRemoveShaderFromWorldTexture(theShader, "hotdog92glass128", vehicles) engineRemoveShaderFromWorldTexture(theShader, "okoshko", vehicles) end end end Right now the tint colour is black, how can I change it into another colour?
-
I think math.random only accepts number 1 and above. math.random() with no arguments generates a real number between 0 and 1. math.random(upper) generates integer numbers between 1 and upper. math.random(lower, upper) generates integer numbers between lower and upper. Might be wrong.
-
[LF] FTW Gaming - We Need You! [Non-Paid]
FlyingSpoon replied to FlyingSpoon's topic in Looking for staff
We've changed our community name, and there's new ownership/leadership as well as other actions taking place. Checkout our skype group: https://join.skype.com/fWHb5HvSv7K7 -
My FPS is 60, and and what do you mean by proper tabs and spacing?
-
It looks like it kind of glitches or something, when it starts.
-
counter = getTickCount() alpha = 0 function firstShow() local progress = ( ( getTickCount() - counter ) / 5000 ) local progress2 = ( ( getTickCount() - counter ) / 2000 ) :Oanim1 = interpolateBetween(1800, 0, 0, 1545, 0, 0, progress2, "Linear" ) alpha = interpolateBetween(alpha, 0, 0, 255, 0, 0, progress, "Linear") dxDrawImage(:Oanim1, 35, 50, 50, ":not/img/circle.png", 0, 0, 0, tocolor(255, 255, 255, alpha), true) if progress >= 0.40 then addEventHandler("onClientRender", root, secondShow) end end addEventHandler("onClientRender", root, firstShow) pawn = 0 function secondShow() pawn = pawn + 0.005 outputChatBox(pawn) local progress = ( ( getTickCount() - counter ) / 3000 ) local progress2 = ( ( getTickCount() - counter ) / 1000 ) local progress3 = ( ( getTickCount() - counter ) / 5000 ) local :Oanim = interpolateBetween(0, 0, 0, 300, 0, 0, progress, "Linear" ) local :Oanim2 = interpolateBetween(1569, 500, 0, 1868.3, 0, 0, progress, "Linear" ) local alpha = interpolateBetween(0, 0, 0, 150, 0, 0, progress, "Linear") local alpha2 = interpolateBetween(0, 0, 0, 255, 0, 0, progress, "Linear") if progress2 >=0.2 then alpha3 = interpolateBetween(0, 0, 0, 255, 0, 0, progress2, "Linear") end dxDrawRectangle(1569, 36, :Oanim, 48, tocolor(0, 0, 0, alpha), false) dxDrawText("Welcome to FTW Gaming! Enjoy!", 1608, 40, 1866, 79, tocolor(255, 255, 255, alpha3), 1.20, "default", "left", "center", false, false, true, false, false) dxDrawImage(:Oanim2, 35, 26, 50, ":not/img/extend.png", 0, 0, 0, tocolor(255, 255, 255, alpha2), false) if progress3 <= 1 then addEventHandler("onClientRender", root, thirdShow) removeEventHandler("onClientRender", root, secondShow) removeEventHandler("onClientRender", root, firstShow) end end function thirdShow() local progress = ( ( getTickCount() - counter ) / 5000 ) local progress3 = ( ( getTickCount() - counter ) / 2000 ) local progress4 = ( ( getTickCount() - counter ) / 3000 ) local progress5 = ( ( getTickCount() - counter ) / 4000 ) local :Oanim = interpolateBetween(300, 0, 0, 0, 0, 0, progress, "Linear" ) local :Oanim2 = interpolateBetween(1868.3, 500, 0, 1569, 0, 0, progress, "Linear" ) local :Oanim3 = interpolateBetween(1868.3, 500, 0, 1569, 0, 0, progress, "Linear" ) local alpha = interpolateBetween(0, 0, 0, 150, 0, 0, progress, "Linear") alpha5 = interpolateBetween(255, 0, 0, 0, 0, 0, ((getTickCount()-counter)/4000), "Linear") alpha6 = interpolateBetween(100, 0, 0, 0, 0, 0, ((getTickCount()-counter)/4000), "Linear") alpha7 = interpolateBetween(255, 0, 0, 0, 0, 0, ((getTickCount()-counter)/4000), "Linear") dxDrawImage(1545, 35, 50, 50, ":not/img/circle.png", 0, 0, 0, tocolor(255, 255, 255, alpha5), true) dxDrawRectangle(1569, 36, :Oanim, 48, tocolor(0, 0, 0, alpha6), false) dxDrawText("Welcome to FTW Gaming! Enjoy!", 1608, 40, 1866, 79, tocolor(255, 255, 255, alpha7), 1.20, "default", "left", "center", false, false, true, false, false) dxDrawImage(:Oanim2, 35, 26, 50, ":not/img/extend.png", 0, 0, 0, tocolor(255, 255, 255, alpha6), false) setTimer ( function() removeEventHandler("onClientRender", root, thirdShow) end, 3000, 1 ) end How can I make my animation smoother, also how can I clean up my code a little, looks messy.
-
if show then local anim = interpolateBetween(757, 0, 0, 0, 0, 0, progress, "Linear" ) local alpha = interpolateBetween(255, 0, 0, 0, 0, 0, ((getTickCount()-tick)/1000), "Linear") dxDrawText(guiGetText(edit_username), anim, 528, 1142, 581, tocolor(255, 255, 255, alpha), 2.00, "default", "left", "center", false, false, true, false, false) else dxDrawText(guiGetText(edit_username), 757, 528, 1142, 581, tocolor(255, 255, 255, alpha), 2.00, "default", "left", "center", false, false, true, false, false) end Okay I tried something, but its not perfect, how can I make the animation more smoother, so what happens is when it clicks the button, it fades away. How can I do that more smother, right now it isnt smooth, and its my first time using interpolate c;
-
Works perfectly @#BrosS
-
alp = 255 -- this is the alpha variable --and then put the aplha in tocolor like this ------------------------- menu = false function showMenu() dxDrawRectangle(0, 0, 1920, 80, tocolor(0, 0, 0, alp), false) -- Top Bar dxDrawRectangle(0, 80, 1920, 10, tocolor(0, 96, 94, alp), false) -- Semi Top Bar end --and now fade it out with timer like this function bindMenu() if menu == false then addEventHandler("onClientRender", root, showMenu) setTimer(function() if alp == 25 then menu = true end alp = alp + 1 end,50,255) else setTimer(function() if alp == 1 then removeEventHandler("onClientRender", root, showMenu) menu = false end alp = alp - 1 end,50,255) end end bindKey("F1", "down", bindMenu) Fixed up your code a little, you were missing a few things, but seems like when I press F1, it fades in then disappears and repeats the process. A little buggy, any fix?
-
local startTick counter = getTickCount() counteralpha = getTickCount() function theRendered() progress = ( ( getTickCount() - counter ) / 5000 ) progressalpha = ( ( getTickCount() - counteralpha ) / 2000 ) local angle = interpolateBetween( 0, 0, 0, 360, 0, 0, progress, "Linear" ) alpha = interpolateBetween( 0, 0, 0, 255, 0, 0, progressalpha, "OutQuad" ) dxDrawImage(790, 308, 308, 328, "sh.png", angle, 0, 0, tocolor(255, 255, 255, alpha), false) if progress >= 1 then counter = getTickCount() end if alpha == 0 then started = false startTick = nil removeEventHandler("onClientRender", root, theRendered) end end addEventHandler("onClientRender", root, theRendered) function loggedIn() startTick = getTickCount() + 1000 outputChatBox("logged in") local progress = (1000-(startTick-getTickCount()))/1000 alpha = interpolateBetween(255, 0, 0, 0, 0, 0, progress, "Linear") end addCommandHandler("logged", loggedIn) how can i make it fade out, once the ./logged command is used?
-
showMenu = false function showMenu() dxDrawImage(x*0, y*0, x*1920, y*1080, "img/bg.png", 0, 0, 0, tocolor(255,255,255,255), false) -- Background Image dxDrawRectangle(x*0, y*0, x*1920, y*80, tocolor(0, 0, 0, 126), false) -- Top Bar dxDrawRectangle(x*0, y*80, x*1920, y*10, tocolor(0, 96, 94, 126), false) -- Semi Top Bar end function bindMenu() if showMenu == false then addEventHandler("onClientRender", root, showMenu) showMenu = true else removeEventHandler("onClientRender", root, showMenu) showMenu = false end end bindKey("F1", "down", bindMenu) I want to know how to fade this DX in, when it is visible, and fade out when it is turned off?
-
showMenu = false function showMenu() dxDrawImage(x*0, y*0, x*1920, y*1080, "img/bg.png", 0, 0, 0, tocolor(255,255,255,255), false) -- Background Image dxDrawRectangle(x*0, y*0, x*1920, y*80, tocolor(0, 0, 0, 126), false) -- Top Bar dxDrawRectangle(x*0, y*80, x*1920, y*10, tocolor(0, 96, 94, 126), false) -- Semi Top Bar end function bindMenu() if showMenu == false then addEventHandler("onClientRender", root, showMenu) showMenu = true else removeEventHandler("onClientRender", root, showMenu) showMenu = false end end bindKey("F1", "down", bindMenu) I want to know how to fade this DX in, when it is visible, and fade out when it is turned off?
-
function UserData(Status,player,userName) if Status == "success" then local query = dbQuery(connection, "SELECT * FROM forum_userpanel WHERE BINARY playerUser=?", userName) local result, numrows, errmsg = dbPoll (query, 1) local row = result[1] if row then setElementData(player,"getForumName",userName) setElementData(player,"loggedin",true) outputDebugString("[Forum] "..userName.." has logged in!") else cr = dbQuery(serverContainer.connection, "INSERT INTO forum_userpanel (playerUser) VALUES (?)", userName) outputDebugString("[Forum] "..userName.." has been activated!") end end end Line 5: attempt to index local 'result' (a nil value) Keeps giving me that error on - 'local row = result[1]' - Any ideas?
-
addEventHandler("onResourcePreStart", rootElement, function (startingResource) fetchRemote("http://link.com/maps/", function(data, errno) if errno == 0 then outputChatBox("Error fetching maps: " .. errno) return end end) --Is starting resource a gamemode? if isGamemode(startingResource) then --Check if another gamemode is running already if getRunningGamemode() and getRunningGamemode() ~= startingResource then -- Initiate a new changemode sequence and cancel this event outputMapManager( "Initiating changemode from '" .. getResourceName(getRunningGamemode()) .. "' to '" .. getResourceName(startingResource) .. "'" ) changeGamemode(startingResource) cancelEvent(true) end elseif isMap(startingResource) then --Check if another map is running already if getRunningGamemodeMap() and getRunningGamemodeMap() ~= startingResource then -- Initiate a new changemap sequence and cancel this event if isGamemodeCompatibleWithMap ( getRunningGamemode(), startingResource ) then outputMapManager( "Initiating changemap from '" .. getResourceName(getRunningGamemodeMap()) .. "' to '" .. getResourceName(startingResource) .. "'" ) changeGamemodeMap(startingResource) end cancelEvent(true) end end end ) So this is the default mapmanager, can't really figure out how to actually fetch the maps, so maps are uploaded via .ZIP format on to the website, and I'm trying to get all the maps, and load them instead of the default location [maps]. How should I do it?
-
bump