-
Posts
1,050 -
Joined
-
Last visited
Everything posted by ViRuZGamiing
-
That's not what I wrote tho?
-
Did you read the example cause it's really that simple: function dxDrawStuff() dxDrawRectangle(x/2-800/2, 0, 800, 50, tocolor(0, 0, 0, 220), false, false) dxDrawText(message, 0, 15, x, y, tocolor(r, g, b, 220), 1, "default", "center", "top", false, false, true) end function sendClientMessage(message, r, g, b, colorCode) local x, y = guiGetScreenSize() local message = tostring(message) if not message then return end r,g ,b = tonumber(r), tonumber(g), tonumber(b) if not colorCode then colorCode = false else colorCode = true r,g,b = getColorFromString(message) end addEventHandler("onClientRender", root, dxDrawStuff) setTimer(function() removeEventHandler("onClientRender", root, dxDrawStuff) end, 5000, 1) end addEvent("sendClientMessage", true) addEventHandler("sendClientMessage", root, sendClientMessage) You might look at setTimer cause that one was quite messed up
-
Example: function whatever() addEventHandler("onClientRender", getRootElement(), example) setTimer(function() removeEventHandler("onClientRender", getRootElement(), example) end, 5000, 1) end function example() --dxdrawstuff end The function needs a name so the removeEventHandler knows where to find the function to be removed
-
Check on Starting a job if they are any other gang/faction
-
onClientRender > setTimer > removeEventHandler (onClientRender)
-
water createWater ( int x1, int y1, float z1, int x2, int y2, float z2, int x3, int y3, float z3 [, int x4, int y4, float z4 ] [, bool bShallow = false ] ) Required Arguments x1, y1, z1: position of bottom left (south-west) corner. x2, y2, z2: position of bottom right (south-east) corner. x3, y3, z3: position of top left (north-west) corner. Note: Only 3 coords creates a triangle You'd need to use 2 more Vector3's Maybe something like this? water = createWater(hitX - 1 hitY - 1, hitZ, hitX + 1, hitY - 1, hitZ, hitX - 1, hitY + 1, hitZ) This would make triangles tho
- 1 reply
-
- 1
-
-
I think (not sure) that it's better to run 1 query instead of multiple queries in a row dbExec (dbConnectTable.connection, "UPDATE core_members SET ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ??, ?? = ?? WHERE `name` = ??", tableAccount[1], 0, tableAccount[2], 0, tableAccount[3], 0, tableAccount[4], 0, tableAccount[5], 0, tableAccount[6], 0, tableAccount[7], 0, tableAccount[8], 0, tableAccount[9], 0, tableAccount[10], 0, tableAccount[11], 0) Don't concat, use ?? and write the parameters in the end. It does seem a lot tho might be a better way and I haven't tested it Note that I've used 0 as value for everything this has to be changed
-
ClientEvent not added client-side error (but event is there)
ViRuZGamiing replied to koragg's topic in Scripting
local screenW, screenH = guiGetScreenSize() local px,py = 1600,900 local x,y = (screenW/px), (screenH/py) function dxDrawBday(nick, age) dxDrawText(nick.." #FFFFFFturned "..age.." today!", screenW * 0.0000, screenH * 0.1648, screenW * 1.0000, screenH * 0.3861, tocolor(255, 255, 255, 255), 1*y, "bankgothic", "center", "center", false, false, false, true, false) end addEvent("drawBday", true) addEventHandler("drawBday", root, function() addEventHandler("onClientRender", root, dxDrawBday) setTimer(function() removeEventHandler("onClientRender", root, dxDrawBday) end,5000,1) end) This is all needed client side (not tested) -
your function name is the same as an MTA existing function 'toggleControl' use something different
-
You need to run this onClientRender
-
How I'd do it is loop through the first elements, store them in a new table. Sort that table insert them in the sorted order back. MySQL might be a bit better for these things imo
-
Thanks didn't even realise I wasn't using guiCreateBrowser since I was looking at that page the whole time
-
Hover doesn't work even slowly, transparency is added. Client x, y = guiGetScreenSize() browser = createBrowser(x, y, true, true, false) addCommandHandler("lgn", function() loadBrowserURL(browser, "http://mta/local/login.html") guiSetInputEnabled(true) showCursor(true) addEventHandler("onClientRender", getRootElement(), function() dxDrawImage((x/2)-200, (y/2)-100, x, y, browser, 0, 0, 0, tocolor(255, 255, 255), true) end) end) Meta <meta> <script src="client.lua" type="client" /> <file src="login.html" /> <file src="user.png" /> <file src="lock.png" /> <min_mta_version server="1.5.0-9.07439" /> </meta> Login Form HTML http://pastebin.com/nHLriSYp
-
[REL] Cinema Experience 2.0 [Updated 13th January 2017]
ViRuZGamiing replied to Tails's topic in Resources
Great work looks really nice (as long that I don't need to watch Anime in MTA now ) -
So you want 1 sound ENABLED and the others DISABLED? Then loop all the sound indexs and blocks that need to be disabled and disable them not sure if disabling a block and enabling a sound in that block will Keep the rest disabled if so disable blocks only.
-
Isn't used for cliënt to server transport, Triggers are. I suggest you start reading the Wiki because I see you react everywhere but none are really helpfull. You Can pass the table as argument with the trigger If the ranks don't change send them on resource start if they change send them each change to update
-
Naturally would Mean walk. My guess would be, set the walking animation since that one moves forward as far as I know. Then check constantly the rotation to that 1 Point (note that there won't be path finding tho) and check if the positionering has been reached if so stop.
-
Atom: http://atom.io Sublime: https://www.sublimetext.com N++: https://notepad-plus-plus.org
-
There's an error with the connection, without a connection you can't execute queries and such. Check your users, I think you should use 'root' as username but check users in PHPMyAdmin
-
Use Atom, Sublime Text or Notepad++ (my suggestion: Atom)
-
Is there a way to make the CSS hover effect work, my HTML is fully function and can I make everything except for my <div> to be shown (it has a border radius) so without the white background being the body.
-
Fixed it by adding it as a <file> in the meta, <html> doesn't work
-
Wiki: Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.
-
Ken al wel enkele namen op het forum maar dacht eens een kennismaking te starten en zo de NL/BE community wat dichter bij elkaar te brengen. Dus ja, ik ben Billy aka Viruzgamiing wat men nogal outdated username is nu. Ik ben met programmeren begonnen door MTA (apart van wat kladblok html). Zonder enig verstand heel veel vragen gesteld aan IIYAMA die waarschijnlijk meerdermaals hetzelfde/iets simpel moest uitleggen. Hierdoor heb ik veel geleerd. Pas toen ik C# leerde, begreep ik LUA ineens. Nu studeer ik Multimedia Technology Virtual 3D. Ik kan C#, SQL basis, Java, HTML, CSS (& SASS), JS (& jQuery), beetje Python, C++ basis. Uiteindelijk kan ik meeste dingen wel maar C# ben ik meeste mee bezig. Ohja ik ben 18 (19, 25 dec) en game veel. Vooral league of legends en Rocket league. Nu probeer ik hier en daar wat mensen te helpen en wat MTA LUA dingen bij te leren.
-
And I quote; 'resourceName: The resource name, local is a special name for the current resource' https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler That's why. didn't knew I had to add it to the Meta tho. Script or file tag?