3aGl3
Members-
Posts
128 -
Joined
-
Last visited
Everything posted by 3aGl3
-
Since you asked for an easy way to do it there is only one answer: No. If you are up for it, it can be done with a bunch of scripting, as Dimos7 wrote, you can create weapons and change their models individually. You could do that for every player that is streamed in on the local client, which would show the weapons the other players have. Using free model ids you can then add new weapon models to the server and apply these to the custom weapons.
-
The most obvious and best way would be to edit the dff files and add a license plate with these two materials: carpback - the background of the carplate, depending on the location the car is created in this will show an LS, LV, etc. license plate carplate - the actual letters of the carplate, this will show the 8 character license plate the car is assigned Now if you don't have access to the models, can't model etc. there would be a different way. As long as the model has a material for any kind of license plate you could use a shader to replace that with anything you want, that said you could use e.g. a HD license plate background and use a render target and dxDrawText to draw the license plate text onto that, then apply it to the model with a shader. This second way will work, however it's a good bit of scripting and could potentially have quite an impact on performance.
-
Yes, this is some "magic" with shaders, to get a little more detailed it works like this: - Multiple shapes, etc. are used for the base, they can be seen in the video, the more shapes, the more options - A render target is used for the different shapes to make a paintjob - A shader is required, a common texture replace shader would work, however you can get more fancy adding reflections, etc. - Cars that have a proper UV map are required, otherwise the placement will be very strange - A pretty lengthy script handles placement of the shapes, applying the paintjob etc. Depending on how you do it the paintjobs are created at one point and applied to the car using the shader. I did play around with a system like this over a year ago and you quickly get results, however you will have to make sure the paintjobs are properly loaded and unloaded, stored etc. I only tried my own system with a few people on a private server we used for fooling around but on weak PCs it caused quite the impact pretty quickly. That was likely caused by me using the render targets all the time, if I create something like this again I will definitely not do that again. Either way, as I said before, the system is rather complex so I doubt that you will find a public one.
-
I think the version posted above with the triggerClientevent is a much better solution. No one except the server and the client himself should really know the account name.
-
You should at least get an overview of most of the functions and probably know the basic, much used stuff well enough to work with. No one ever said you have to learn all the functions with what they return and all their arguments but if you have never heard of functions you will eventually try to solve problems that don't exist. e.g write functions in lua that are already native to MTA. Also you should get a good editor with syntax highlighter and possibly auto completion, I suggest Atom (it has a mta lua plugin), that makes things a whole lot easier to read.
-
In the wiki is also an introduction to scripting, along a function reference. If you already have experience with any sort of scripting or programming you can probably just dive into it and do some small scripts to get the hang of the lua syntax.
-
If you created the script yourself you will have to write script that takes care of the blips (and radar areas too I guess). You will have to do something like this: local blips = getElementsByType( "blip" ) for i, blip in ipairs(blips) do local x, y, _ = getElementPosition( blip ) local v = 0 dxDrawImageSection( x, y, 10, 10, 0, v, 16, 16, blipTexture ) end This is assuming that you have a sprite with all blips, which seems like a good idea to me. Also you will need to calculate the V position based on the ID the blip is, if the blip has a color you might want to take that into account etc. Oh and of course you will need a render target so the radar map can be updated by dx drawing on it.
-
And what would that do for the sake of the question asked? The OP wants to change the style the gun is used, for a RP server as far as I understood. Changing things in your gta3.img will only be visible for you.
-
You should probably use this only: DELETE FROM house WHERE id=? Assuming of course that id is unique, as it should be in a good database.
- 1 reply
-
- 1
-
You are totally correct. An image with those dimensions is 1MB in size. No idea why MTA uses 2MB to save it to RAM...maybe it has mip maps...?
-
You'll have to set all the files in the meta to download="false", so only scripts are downloaded when the player connects. As scripts are usually fairly small it shouldn't take too long. After that you'll have to make a custom downloader to load all the files. For that you will have to use the downloadFile function as well as the onClientFileDownloadComplete event. While I don't think that you can get the status of the currently downloading file you can get the progress of the overall download by getting all files sizes and working with them.
-
My first though was to export the cop animations from the game and load them instead of the default colt anims but EngineLoadIFP has been disabled. Maybe it would be possible to change the players animation to the cop anims, using setPedAnimation, when he aims and shoots though?
-
I guess that either the render target could not be created successfully or that rr is used somewhere else. Since you never set the scope of rr it's a global variable for the entire client side. To eliminate that possibility just add this to the top of the script: local rr, rr2 If that doesn't fix the error it's likely that the creation of the render target failed, you can't do anything about that. Edit: Just to clarify, "you can't do anything about that" means that render target creation fails because of hardware limitations. So if you can reduce memory usage that could possibly fix the problem.
-
So if I understand you correctly you want a row of ten consecutive numbers between 10 and 100. I'd just get a number between 10 and 90, that way the random and the following 9 numbers make up your ten consecutive numbers.
-
They are probably all private, at least I don't know of a public one. It's been a bit but I did search for one too...
-
The script would be quite lengthy for a full system like the one in your example. You will need to create a shader for every paintjob and apply the texture as a variable to it. Then apply the shader to all vehicles that have the paintjob. To make it usable on a server you probably want to destroy and create the elements as needed, when vehicles stream in and out.
-
Hm, my getAngle function works with y, then x: function getAngle( x1, y1, x2, y2 ) local x = x2 - x1 local y = y2 - y1 return math.deg( math.atan( y, x ) ) end
-
Well, it really depends on what you want to do. Let's just assume you want to make a dxGUI with scroll areas, I'd go about it something like this: function createDxScrollPane( x, y, parent ) local pane -- create an element, a table or whatever -- save x, y, apply parent bla bla bla -- try to create a render target for smooth scrolling local render_target = dxCreateRenderTarget( x, y, true ) if render_target then -- save the render target end return pane end -- for render event function drawDxScrollPane() local scroll_x, scroll_y = getScrollPos( pane ) if render_target then -- draw to the render target else -- we scroll line by line and char by char local line_h = 15 local pos_y = line_h * scroll_y * y for k, v in ipairs(children) -- draw only text that is below pos_y -- draw only parts of images that are visible below pos_y -- etc. end end end Note that I made all that up on the fly but it should get the point accross.
-
If the memory is full it's full, not much you can do. You could delete unused things. If the render target wasn't set successfully the function returns false, if the render target wasn't even created successfully dxCreateRenderTarget will return false too. If you want to clip of parts of a texture then yes, dxDrawImageSection is there. Otherwise you could probably work with some smart scripting.
-
So I'm working on a gamemode/server that I plan to possibly host on a larger scale. The project is only for my own amusement and may never be hosted on a large scale, or even finished, however I'd still like to prepare for that. While player interactions on a small scale can be tested easily by using a laptop, virtual pc etc. I was also wondering how one would test load specific things. For example what happens when a player enters a populated area and has to stream in many elements that require shaders or similar. What happens to per player dxDraws like nametags or chat bubbles? Does anyone have any experience with such things and would share? Can peds be used instead of actual players? (I imagine some extra script would be possible but that shouldn't be to big a problem)
-
Well, not to be like that but... Are you sure it's the LOD model? After what I pointed out already everything seems fine...maybe the --irelevant code removed hides something that also spawns the base object multiple times.