Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. pa3ck

    Own ban system.

    Oh, okay, thank you. I've never used timestamp before. So, when I ban someone, which timestamp would I save? How am I going to convert it with the ban length?
  2. pa3ck

    Own ban system.

    What do you mean by converting it to timestamp? I don't get it.
  3. Hello there, the default MTA ban system is not working the way I want it to, so I'll need to make my own ban system. The thing is, I have no clue how to even start it. If I ban somebody, how I'm going to check if the ban is over? I'll save the date and time along with the duration ( using MySQL), that's okay, but I have no idea how to check if the player is still banned. Any idea?
  4. Okay, that's perfect, thank you.
  5. Very well done! Is it going to be in the next MTA update?
  6. Yea, sorry if I haven't explained it clearly. EDIT: It only happens when they're attached to an element as a child ( even though they're attached to 2 different ones ).
  7. That's what I thought. Thank you. Any ideas on work around?
  8. It works if they're not attached to a parent. I used dxDraw to draw the background, but changed to guiStaticImage and set the edits as children. The code is just simple guiCreateStaticImage and 2 edits and 2 buttons, but sure, here's my code: local sizeX, sizeY = 0.64, 0.9 local tPic = math.random(1, #pics) img = guiCreateStaticImage (0.5 - sizeX / 2, 0, sizeX, sizeY, unpack(pics[tPic]), true) user = guiCreateEdit ( 0.376, 0.417, 0.218, 0.042, "", true, img ) pass = guiCreateEdit ( 0.376, 0.507, 0.218, 0.042, "", true, img ) reg = guiCreateButton ( 0.385, 0.563, 0.094, 0.042, "", true, img ) login = guiCreateButton ( 0.5265, 0.563, 0.067, 0.044, "", true, img ) guiSetAlpha(login,0) guiSetAlpha(reg, 0) guiEditSetMaxLength(user, 50) guiEditSetMaxLength(pass, 50) guiEditSetMasked ( pass, true )
  9. Hi there. I can't switch between guiEdits when they are attached to the same parent. Is this an MTA bug?
  10. local screenS = { guiGetScreenSize () } local rectangleWidth, rectangleHeight = screenS [ 1 ] * 0.5, screenS [ 2 ] * 0.3 -- Multiplying screenS [ 1 ] ( screen width ) by 0.5 gets you the half of your screen's length, 0.3 is 30% and so on. Do the same with positioning.
  11. Just create a timer for 10 seconds as soon as you spawn and check if the timer is still going ( isTimer ) and don't allow the player to shoot if the timer is still on.
  12. Do you get any errors in /debugscript 3? Also, are you sure you need to update it? Did you insert it first?
  13. Anything else, sir? You did realize, its not a requesting section, right? Try to do it yourself and if you have any issue(s), you can ask for help here.
  14. I haven't seen your whole code, so I just give you an example so that you can edit it: local m95a = createObject( 1337, 0, 0, 0) attachElements(m95a, localPlayer, 0, 3, 0) bindKey( "mouse2", "down", function ( ) local slot = getPedWeaponSlot( localPlayer ) if slot == 6 then setElementAlpha ( m95a, 0 ) end end ) bindKey( "mouse2", "up", function ( ) local slot = getPedWeaponSlot( localPlayer ) if slot == 6 then setElementAlpha ( m95a, 255 ) end end )
  15. Yea, forgot about that, it was just a parameter in the event, thanks.
  16. local x, y = guiGetScreenSize() local sx, sy = guiGetScreenSize() local nev = "" local reasons = { ["unknown"] = "Ismeretlen.", ["quit"] = "Kilépett.", ["kicked"] = "Kirúgva.", ["banned"] = "Kitiltva.", ["bad connection"] = "Rossz kapcsolat.", ["timed out"] = "Időtúllépés.", } function drawCsatlakozas ( ) -- 1411, 228, 269, 84 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.08, tocolor(0, 0, 0, 125), true) -- 1411, 312, 269, 21 dxDrawRectangle(x*0.83988, y*0.297142, x*0.160119, y*0.02, tocolor(0, 0, 0, 185), true) -- 1411, 228, 269, 21 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.02, tocolor(245, 140, 20, 200), true) -- 1425, 234, 1680, 244 dxDrawText("Csatlakozás / Kilépés", x*0.848214, y*0.2228571, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1430, 453, 1680, 244 dxDrawText("CoreGaming", x*0.8511904, y*0.380952, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1465, 249, 1657, 280 dxDrawText(nev, x*0.872023, y*0.237142, sx*0.985, sy*0.266666, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) -- 1455, 285, 1675, 302 dxDrawText("csatlakozott a szerverre.", x*0.8660714, y*0.271428, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end --addEventHandler("onClientRender", root, drawCsatlakozas) function drawKilepes( ) -- 1411, 228, 269, 110 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.104761, tocolor(0, 0, 0, 125), true) dxDrawRectangle(x*0.83988, 338, x*0.160119, y*0.02, tocolor(0, 0, 0, 185), true) dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.02, tocolor(245, 140, 20, 200), true) dxDrawText("Csatlakozás / Kilépés", x*0.848214, y*0.2228571, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1430, 453, 1680, 244 dxDrawText("CoreGaming", x*0.8511904, y*0.430952, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1465, 249, 1657, 280 dxDrawText(nev, x*0.872023, y*0.237142, sx*0.985, sy*0.266666, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("lecsatlakozott a szerverről.", x*0.8660714, y*0.271428, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) -- 1455, 340, 1675, 302 dxDrawText("[ " .. reasons [ string.lower ( reason ) ] .." ]", x*0.866071, y*0.3238095, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end --addEventHandler("onClientRender", root, drawKilepes) addEventHandler("onClientPlayerJoin", root, function() nev = getPlayerName(source) addEventHandler("onClientRender", root, drawCsatlakozas) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawCsatlakozas) end, 5000, 1 ) end ) addEventHandler("onClientPlayerQuit", root, function ( reason ) nev = getPlayerName(source) reason = reason addEventHandler("onClientRender", root, drawKilepes) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawKilepes) end, 5000, 1 ) end )
  17. Make a table for the reasons, then look for it when somebody disconnets or move the 'if' statements inside your function. ( elseif would be handier, wouldn't it? )
  18. it get name of the vehicle Exactly. You can't destroy a vehicle name, thats not an element. Use Solidsnake's code, that should work.
  19. Do you even know what does getVehicleName do?
  20. pa3ck

    Lock this

    There is. local myTable = { [ "text" ] = "This is the first text.", } myTable.text2 = "And here comes the second one." outputChatBox( myTable [ "text" ] ) outputChatBox( myTable [ "text2" ] )
  21. And it is exported as server side function?
  22. pa3ck

    Is this ok?

    Yea, it will work just fine. If myTable[row-1] returns nil or false, it will automatically return myTable[9].
  23. pa3ck

    Lock this

    You can save the groups, members, leaders and all that sort if things, but you cant save the memo? How come? Its pretty much the same thing... You probably have a table or something with the members of a given team, just insert your text there and retreive it whenever you need it.
×
×
  • Create New...