johny46
Members-
Posts
81 -
Joined
-
Last visited
Everything posted by johny46
-
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.
-
https://wiki.multitheftauto.com/wiki/GuiCreateMemo
-
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/
-
You could easily use an array for that, would be a lot cleaner.
-
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.
-
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.
-
What arrow and what markers do you need? Not everyone plays NFS:MW here.
-
Eh, I forgot about that "remotely triggerable" thingy, my bad. Just replace addEvent("onClientZombieWasted") by addEvent("onClientZombieWasted", true)
-
Not possible using the default functions, but this can be worked around using dx functions. See: https://wiki.multitheftauto.com/wiki/DxDrawGifImage
-
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.
-
Have you ever scripted anything before? If not, you may consider starting learning from something easier than jobs.
-
Tworzenie ekwipunku
johny46 replied to Ksantus12's topic in Pomoc ze skryptami i programowaniem w Lua
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) -
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.
-
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
-
https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL
-
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.
-
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
-
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.
-
You are trying to call function getLocalPlayer() serverside, but this function exists only clientside. Is it your code?
-
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.
-
Pobieranie pozycji kamery
johny46 replied to KubasGC's topic in Pomoc ze skryptami i programowaniem w Lua
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ść. -
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".
-
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.
-
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.