LabiVila
Members-
Posts
272 -
Joined
-
Last visited
Everything posted by LabiVila
-
Very first of all, second argument of `outputChatBox` in client-sided shouldn't be a player, just the color codes, and your fifth argument isn't needed since you added no hex color codes into your sentence. Secondly have you declared the 'isElementInRange' function? If that's all your code, it's invalid as well. Third, you don't have to use both 'onResourceStart' and the command handler at the same function literally. If you use command handler only, it would be called when you write the /gate1 even if there's no onResourceStart. If this isn't all your code, try to post it all
-
Lol it's quite hard to understand that English, I thought he wanted to kick everyone who has > 300 ping but Admins, however
-
setTimer ( function () for _,v in ipairs (getElementsByType ("player")) do if (getPlayerPing > 300) then if (isGuestAccount (v) == false) then --you can as well delete this line, it may output some errors if you do that if (isObjectInACLGroup ("user."..v, aclGetGroup ("admin")) then --your group in ACL must be called 'admin' return else kickPlayer (v, "Ping over 300 and you are not in admin group") end end end end end, 5000, 0 )
-
Post the whole script, it won't be leaked. Otherwise none is gonna be able to help you.
-
Can you post the whole script?
-
If you know how to work with MySQL, then definitely go for it. But do not work with both, if you connect it to your forum, make sure to disable /login, /register commands from your server, so old db won't interfere with MySQL one, otherwise it will get too messy.
-
This was explained like 10 times earlier, you better search previous topics, but however: local x,y = guiGetScreenSize () bg = guiCreateWindow(0, 0, 850*x/yourReslutionX, 850*x/yourResolutionY, "Spawn menu", false)
-
If you give your full code, maybe we can help you, the wiki is quite clear
-
Can you be more clear? So you want to check someone's serial whom's nickname is "LOL", if it is then get his serial and kick him, right?
-
They're outdated already, and no, a query has no relation to connecting with MySQL, instead of that, use this one: https://wiki.multitheftauto.com/wiki/DbQuery
-
Another cool way of doing that is this: bindKey ("F1", "down", function () windowstate = not windowstate if windowstate then guiSetVisible (buttons, true) addEventHandler ("onClientRender", root, dxPanel) showCursor (true) else guiSetVisible (buttons, true) removeEventHandler ("onClientRender", root, dxPanel) showCursor (false) end end ) you don't have to declare much variables or stuff, and you might as well want to use guiSetInputEnabled (true), as it won't output to chatbox things you write in your dxPanel
-
If it's only about saving player's position, I wouldn't recommend MySQL nor SQLite, you can do with account data, much easier & better
-
So hello, my question is simple, I need a (some) way(s) do draw a non-pixelated circle. How do I do that? I already tried dxDrawCircle but it is very pixelated, it doesn't look so decent. Thanks further
-
Your resource may have created caches, try moving all these to a new folder, and rename .png files, also, as far as I know, file's src shouldn't contain client as type
-
Nevermind, got it done, thank you anyway
-
Yes, if I keep 'debugging it', at 'if (v == source)' gives an error
-
local players = {} function onjoin () table.insert (players, source) setTimer ( function () for k,v in ipairs (players) do if (v == source) then table.remove (players, k) end end triggerClientEvent ("handler", getRootElement(), players) end, 5000, 1 ) triggerClientEvent ("handler", getRootElement(), players) end addEventHandler ("onPlayerJoin", getRootElement(), onjoin) function handler (players) addEventHandler ("onClientRender", getRootElement(), function () for i,v in ipairs (players) do dxDrawText (i.." "..getPlayerName (v), 200, 200 + (i * 21)) end end ) end addEvent ("handler", true) addEventHandler ("handler", getRootElement(), handler) so, 5 seconds after joining, the text should dissapear, but it is not dissapearing, it is most likely table.remove that isn't working, can I have some help?
-
Are you maybe trying to use getAccountData?
-
addEventHandler ("onClientResourceStart", getRootElement(), function () local word = "" showCursor (true) end ) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function drawing () dxDrawRectangle (300, 300, 200, 100, tocolor (255, 255, 255)) dxDrawText (word, 310, 305, 200, 100, tocolor (255, 255, 255)) end addEventHandler ("onClientRender", getRootElement(), drawing) addEventHandler ("onClientClick", getRootElement(), function () if isMouseInPosition (300, 300, 200, 100) then outputChatBox ("You have clicked the rectangle, start writing") addEventHandler ("onClientCharacter", getRootElement(), writeInBox) end end ) function writeInBox (key) word = word .. key end It is somehow like this
-
Using guiGetText wouldn't really make a proper edit box. You can do it one this way, you declare an empty string, so you have to get mouse's position, if mouse is within the specified rectangle, and it clicks, then you start using onClientCharacter, which would look like this: addEventHandler ("onClientCharacter", getRootElement(), function (key) yourstring = yourstring .. key end ) then draw the text with onclientrender, this is the way I do it
-
I would not suggest you to use dxDrawImage, it'd be better if you use rectangles, it's almost the same believe me, especially for an UP.
-
Well, you would want not to use draw images, you can just manipulate with rectangles. As for screen size, dxDrawRectangle (400, 400, 200, 200, tocolor (255, 255, 255)) applying screen size would look like this: dxDrawRectangle (400/800*x, 400/600*y, 200/800*x, 200/600*y, tocolor (255, 255, 255)) this would only work if your coordinates are 800 x 600, and making sure you have defined x,y as screen size. And as for animations, you can use interpolateBetween, best solution I know