3aGl3

Members
  • Content count

    114
  • Joined

  • Last visited

Community Reputation

16 Decent

1 Follower

About 3aGl3

  • Rank
    Sucka

Details

  • Gang
    Groove
  1. Perhaps your game only runs on a low FPS rate? Other than that I'd try to get the start time the first time you calculate the progress, that might help. Also proper tabs and spacing will help to make your code cleaner.
  2. You should establish a database connection when the resource starts and use that for all the queries.
  3. Try this: <meta> <info author="Ridden" name="Name" version="1.0" type="script" /> <oop>true</oop> <script src="main.lua" type="server" /> <script src="main_c.lua" type="client" /> </meta> I would assume that author and name have to be filled as they will be listed on the page...
  4. So I can't see anything wrong with it on the first look, however if you use myShader somewhere else in your resource it could conflict. To solve that you will have to make the variables local, like this: addEventHandler("onClientResourceStart", resourceRoot, function() local myShader = dxCreateShader( "shader/shader.fx" ) local myTexture = dxCreateTexture( "img/1.png" ) dxSetShaderValue( myShader, "gTexture", myTexture ) engineApplyShaderToWorldTexture( myShader, "alleydoor9b" ) end ) Do note that I changed the textures variable name, it's always helpful to stick with speaking variable names Another thing that I could imagine to go wrong would be the texture name, did you use shader_tex_names to find it? Edit: It's also worth mentioning that you should include some error handling, as the creation of the shader is not guaranteed.
  5. As far as I understand it you simply set the desired bits on in the byte and build the hex number like this: 0x0004400 or 0x0044000 depending on what endianess the game uses for those flags.
  6. Well, flags are sort of easy to understand the more you break them down. First of all you have to know how a computer handles numbers, in particular integers. So let me give you the super basic rundown... Let's for example take the number 1337 as a Base10 number, what we usually work with. Now in Base16, also called Hex it would be, 539. Why hex you may ask, well one hex digit has exactly 1 byte. That being said the number would be 0101 0011 1001 in Base2, also known as Binary. Why all this? Well flags are stored as integer numbers, however their data is hidden in their binary form. Each bit stands for something that can be toggled on or off, being 1 or 0 respectively. Now since each bit is a different number you can have all of them in a different state. Let's take this for example: 1 (0001) - is van 2 (0010) - is bus 4 (0100) - is low 8 (1000) - is big Given these values: 1 van 2 bus 3 "van bus" 4 low ... 15 "low big van bus" GTA expands on that, taking 8 bytes and making them into one number, resulting in a full int_32 integer number.
  7. The fifth and 6th byte of the model flags actually change the camber of the wheels.
  8. As I said before, the wheels rotation is controlled by the engine, you can actually use getVehicleComponentRotation on the wheels to get the steering angle.
  9. I don't think you can rotate the wheels at all, because their rotation is engine controlled.
  10. That is why I said you need a properly UV mapped car. If it's basically unfolded you don't need to do any maths, just move it around on the 2D UV map. The one seen in the video looks probably like this: Whereas an even better UV map would have the bumpers in front and behind of the car. However you could of course also just do it like in the latest NFS incarnation and have bumpers etc. separated from the main body. Worst UV maps look like the ones of the original SA cars, where parts are everywhere and the sides use the same texture, that will result in the paint job always being mirrored.
  11. Actually there isn't that much to it, while the player is editing his paintjob you simply apply the render target to the shader and the shader will update in realtime. Since you have to refresh the render target every frame, using dx draw functions this will also be in sync with the car. For the shader itself I can't tell you to much, as I still don't get them fully. (In my opinion HLSL is a very strange language) However as far as I get them they update in real time anyway, so there is no need to worry on that end either.
  12. 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.
  13. license plate

    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.
  14. 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.
  15. 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.