Jump to content

johny46

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by johny46

  1. I thnik what he meant was "It makes the server vulnerable to hackers who would use the same nick". The point is, Chronic uses it only on his local server so he doesn't have to type in his credentials every time he joins. As far as he doesn't use it on a public server, it's fine.
  2. https://wiki.multitheftauto.com/wiki/GuiCreateMemo
  3. johny46

    DxDraw

    There are many ways to accomplish this. You can for example use it as a dictionary: table = {level0 = "file.png", level1 = "file.png", level2 = "file.png"} You can then use this syntax to retrieve filenames: filename = table["level"..playerLevel] There's a good tutorial on that here: http://phailed.me/2011/02/learn-lua-the ... ay-tables/
  4. johny46

    DxDraw

    You could easily use an array for that, would be a lot cleaner.
  5. johny46

    Timer

    You would still need to check whether the "source" is a zombie using isPedZombie() , which is a serverside function, so it would still require triggering server events and all that stuff. Or maybe there's some other way to check whether a ped is a zombie (eg. getElementData()), but I don't know of any other because I've never ran that zombie gamemode myself.
  6. Well, as far as I know, banning a player disconnects him from the server, and after that you can't execute any code on their machine. One thing you could do, would be setting a timer whenever you ban someone, so the player is banned in eg. 5 seconds after the admin supplies the ban command. You then have these 5 seconds to display dxText to them, or whatever you want to do.
  7. What arrow and what markers do you need? Not everyone plays NFS:MW here.
  8. johny46

    Timer

    Eh, I forgot about that "remotely triggerable" thingy, my bad. Just replace addEvent("onClientZombieWasted") by addEvent("onClientZombieWasted", true)
  9. Not possible using the default functions, but this can be worked around using dx functions. See: https://wiki.multitheftauto.com/wiki/DxDrawGifImage
  10. johny46

    Timer

    I don't know what zombie gamemode do you use, so I don't know whether "onClientZombieWasted" exists. Assuming it does not, you could use this code serverside: addEvent( "onZombieWasted" ) addEventHandler( "onZombieWasted", getRootElement(), function( killer ) givePlayerMoney( killer, 1500 ) triggerClientEvent(killer,"onClientZombieWasted", resourceRoot) end and this code clientside: function onTest() dxDrawText("+1500", 1211, 51, 1351, 77, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1211, 49, 1351, 75, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1209, 51, 1349, 77, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1209, 49, 1349, 75, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1210, 50, 1350, 76, tocolor(0, 100, 35, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) end addEvent( "onClientZombieWasted" ) addEventHandler( "onClientZombieWasted", root, function() addEventHandler("onClientRender", root, onTest) setTimer( function () removeEventHandler ( "onClientRender", root, onTest ) end, 3000, 1) end) Again, I don't know what zombie resource do you use, so it may not work properly.
  11. Have you ever scripted anything before? If not, you may consider starting learning from something easier than jobs.
  12. Chodziło chyba o to, że nie ma sensu instalować całego XAMMP, skoro i tak będziesz korzystać tylko z MySQL. A pewnie MySQL dołączany do XAMMP wymaga XAMMP do działania. Zawsze to jakieś obciążenie komputera. Po co marnować zasoby na utrzymywanie serwera XAMMP jak można je jakoś użyteczniej wykorzystać? (nie używałem nigdy XAMMP, to tylko moje domysły)
  13. The GUI look (including rounded corners) depends on the MTA theme a player is using, and as far as I know, you can't force some GUI theme to players. It's up to them which theme they use.
  14. Sure it is possible. Try this: if getResourceState(getResourceFromName("your resource name")) == "running" then --don't warp ped into vehicle else --warp ped back to his vehicle end
  15. johny46

    MySQL Errors

    https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL
  16. You've got a typo at line 46: showCursos(true) It should be showCursor(true) I haven't tested your code, so I don't know what your problem may be, but just try fixing this typo and check whether problem still exists.
  17. Well... Have you tried just subtracting the coordinates from each other? Like this: relX = x1 - x2 relY = y1 - y2 relZ = z1 - z2 Depending on the order you subtract, you'll get relative position of pos1 according to pos2, or relative position of pos2 according to pos1. --- It appears 50p was faster
  18. What exactly did you change? And have you done what Sasuke said? The "server.lua" file should be clientside and "client.lua" should be serverside. You can fix that in your "meta.xml" file, where you have to change "server.lua" to be clientside and "client.lua" to be serverside, or simply rename the files, so "server.lua" becomes "client.lua" and vice versa.
  19. You are trying to call function getLocalPlayer() serverside, but this function exists only clientside. Is it your code?
  20. johny46

    Timer

    Yeah, just like that, except you have to do addEventHandler("onClientRender", root, onTest) setTimer(removeEventHandler, 3000, 1, "onClientRender", root, onTest) whenever a zombie gets killed. So the proper code should look like this: function onTest() dxDrawText("+1500", 1211, 51, 1351, 77, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1211, 49, 1351, 75, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1209, 51, 1349, 77, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1209, 49, 1349, 75, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("+1500", 1210, 50, 1350, 76, tocolor(0, 100, 35, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) end addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", root, function( killer ) givePlayerMoney( killer, 1500 ); addEventHandler("onClientRender", root, onTest) setTimer(removeEventHandler, 3000, 1, "onClientRender", root, onTest) end) You are probably still going to tweak this a bit, so it behaves properly when two zombies get killed in a period shorter than three seconds.
  21. Zamiast getCameraMatrix() użyj funkcji getWorldFromScreenPosition() Gotowy kod: local targetX, targetY, targetZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 100) setWeaponTarget(gun[source], targetX, targetY, targetZ) Poeksperymentuj trochę z trzecim argumentem żeby znaleźć odpowiednią wartość.
  22. johny46

    Timer

    That's exactly what I said. You need to add event handler when a zombie gets killed, and then create a timer to remove that event handler. The dx functions are displayed only for one frame, that's why you have to display them "onClientRender".
  23. johny46

    Timer

    Then you have to create an "onClientRender" event handler every time you want to display your text, and then create a timer to destroy the handler after 3 seconds.
  24. johny46

    Timer

    Have you tried using Textlib? https://forum.multitheftauto.com/viewtopic.php?f=91&t=24262 It's probably the easiest way to achieve what you are talking about.
×
×
  • Create New...