-
Posts
99 -
Joined
-
Last visited
Everything posted by vx89
-
What event did you try to cancel? Try this (server-side code): addEventHandler("onPlayerChat", root, function() cancelEvent() end)
-
Currently the title is Multi Theft Auto • View topic - Topic name, but having many browser tabs open I just see Multi Theft Auto • View..., so it would be nice to have a pattern Topic Name - View topic • Multi Theft Auto, or View topic - Topic Name • Multi Theft Auto
-
Good job, therainycat!
-
Python and Java is getting added?
vx89 replied to Dretax's topic in Site/Forum/Discord/Mantis/Wiki related
Lua is OK language. Think if we had to use php instead. You could however use javascript now as well though I wouldnt recommend it for reason just to avoid Lua. -
Didnt know the playercount is so high. Great - keeps MTA alive.
-
Added new version (0.2), which adds some tetris-gameplay features. Added holding (with left shift) and sound effects. Also added wall/floor kick and lock delay (i.e you can rotate/move tetromino on landing, except if hard dropping it, for half a second before it's fixed and new tetromino appears).
-
1 and 2) No. I don't know the details, but I am certain that MTA server does not send so detailed data (e.g bullet coordinates) about players who are far away. So (still guessing) indeed 50 players together would cause more data to be sent from server to each of these players if they are nearby. Odds are that rendering these 50 vehicles/peds/whatever could be problematic for player's computer so lag wouldn't be the first problem anymore. 3) Don't know about that, as it's very much implementation specific. I would guess that MTA sends diffs with previous coordinates (instead of full coordinates) just to have a shorter package, so if something is standing still there would be less data, but perhaps I'm wrong. But as usual, questions start from a problem - did you have some? Or are just curious?
-
Haven't tested, but perhaps this would give you something: local resource = getResourceFromName(getElementID(resourceRoot)) where resourceRoot is the predefined global variable, which is equal to getResourceRootElement() - but of course, you'd not be using this resource root element as otherwise you'd just use getThisResource().
-
LOL, don't get this the wrong way (I am java a developer and generally like java), but I played a little game of guessing your age by your signature and nailed it!
-
Just some random thoughts: 1) You could avoid nesting some if's by returning negative cases early 2) don't need or should use parenthesis around simple statements if not id then outputChatBox("ID was not specified: ", thePlayer) return end -- calling tonumber after not id check, because if id was nil I don't really know what tonumber does, and checking "if not some_number" is ambiguous imo id = tonumber(id) if id <= 400 or id >= 612 then outputChatBox("Incorrect ID : "..id, thePlayer) return end local posX, posY, posZ = getElementPosition(thePlayer) local createdVehicle = createVehicle(id, posX + 5, posY, posZ, 0, 0, 0, "Crossy") local vehicleName = getVehicleName(createdVehicle) warpPedIntoVehicle(thePlayer, createdVehicle) outputChatBox("Vehicle Created : "..vehicleName, thePlayer)
-
You could use a third party youtube video to audio conversion service, but first you need to find such service (or create it yourself). Too popular services will be down sooner or later, though (e.g https://www.youtube-mp3.org/help-us)
-
you should use stopSound(sound) and make sound non local variable then (and your music/music.mp3 might not been added to meta.xml as client side file)
-
You should be able to, yes. But triggering javascript by Lua is not allowed in that case (javascript in general is allowed though).
-
I wish I could : a) change Origin http header (Chrome itself disallows it, for security reasons). b) Get response from request as text. Reason would be to create Spotify controller (something like this: https://github.com/cgbystrom/spotify-lo ... _remote.py ) Origin header override would be required to get a token from blabla.spotilocal.com/simplecsrf/token.json as currently only open.spotify.com and few other selected sites are allowed to make requests to local spotify server. I am not absolutely sure, about security context for MTA and (a), maybe it could be whitelist based like domains are. or if such security feature is actually needed.
-
Correct. There are just so many more computers which can handle MTA:SA than GTA 5.
-
Hello, guiCreateStaticImage is not a function that just creates an image, but it also draws it (using CEGUI that mta:sa uses). Looking at scoreboard's API (exported functions) there does not seem to be a standard way to add images without changing scoreboard resource itself. There might be a way to do it without modifying scoreboard resource, but it is not documented.
-
If you are using it on screen render event, then you don't need an event for couch-state-change indeed (assuming isPedDucking is not very expensive).
-
You could use bindKey() -- "useful function", see [url=https://wiki.multitheftauto.com/wiki/BindControlKeys]https://wiki.multitheftauto.com/wiki/BindControlKeys[/url] bindControlKeys("crouch", "down", function() if isPedDucked(localPlayer) then -- ducked else -- unducked end end) Have not tested (maybe isPedDucked does not return true immediately after pressing the button) Alternatives for isPedDucked() though no reason to use these: getPedMoveState(localPlayer) getPedTask(localPlayer, "secondary", 1)
-
Now that Google Code will be closed for commiting in August, GitHub will probably be used. http://google-opensource.blogspot.com/2 ... -code.html
-
I don't know why, but some font files have bad performance. You could try with a different font, or a different format of this font.
-
Xeon's solution is the correct one. However, before destroying the vehicle (if you even want to) call cancelEvent() so that the player just cant get inside it. I'm not 100% sure if onVehicleEnter is called when somehow switching vehicle (not actually entering it).
-
Hey, Yep, I read about that topic, and this was what triggered me to find alternative method (to actually override the cursor, not try to emulate own cursor). Was just looking into it for fun.
-
Hey, Just wanted to share a nasty little trick to have a custom cursor for a window (should also work with any other gui element): function getImageReference(imagePath) local staticImage = guiCreateStaticImage(0, 0, 0, 0, imagePath, false) guiSetVisible(staticImage, false) return guiGetProperty(staticImage, "Image") end local imgRef = getImageReference("client/img/mouse.png") local myWindow = guiCreateWindow( 0, 0, 0.5, 0.4, "Information", true) -- create a window which has "Information" in the title bar. guiSetProperty(myWindow, "MouseCursorImage", imgRef) Too bad the very root window is not accessible (guiRoot) for guiSetProperty - but probably better for security reasons. Also, it doesn't seem to be possible to make a click-through full screen window and use a custom cursor, because if you set "MousePassThroughEnabled" for a window property, then it will not catch mouse hovering and you won't get the custom cursor. But still, maybe this is useful for someone.
-
Thanks for the heads-up, but I'm more worried about resource developers overusing it (e.g using it for UI combined with angular+some animations). But it also allows to implement a lot of great ideas, so thanks for your work!
-
Suggested alternative isLineOfSightClear is not enough?
