Jump to content

3aGl3

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by 3aGl3

  1. You could try to load that text from a file or similar and then use guiSetText, similar to this: local text local file = fileOpen( "welcome_text.txt" ) if file then text = fileRead( file, fileGetSite(file) ) fileClose( file ) end -- things happen here... GUIEditor.memo[1] = guiCreateMemo(0.46, 0.10, 0.48, 0.81, "", true, GUIEditor.window[1]) guiSetText( GUIEditor.memo[1], text ) -- more things happen here...
  2. dxCreateFont should not be part of the onClientReder call. If that is the case for you (you've given very little code, so we can't tell) that could lead to crashes.
  3. Did you two check if the mta process has access rights onto the *.db file?
  4. That seems like a good idea, just feed the table dynamical. When a relevant ped streams in on the client add it to the table, when it streams out remove it again.
  5. So, just giving a few ideas here, based on what info you gave... Why exactly do you need to loop through all of the peds? Can you break down the table further so the amount you loop through gets smaller? Can you reduce the amount the loops are run, e.g calling the loop less often?
  6. No no, you don't send the localClient to the Server. This is handled by MTA internally and will be available in the event Handler on the server side as the client variable. Sending the client to the server would work but it's pointless as you have the client variable and it's also unsafe as the elements send can be faked. See this thread for further predefined variables, also take a look at the triggerServerEvent entry in the wiki...
  7. This is really not the right place to ask this, this is the scripting section. If you have ssh access to the machine, with root rights you can just install mysql. Assuming you have a generic Linux machine it should be sudo apt-get install mysql-server If that doesn't work or you have a Windows Server look for a tutorial on how to install MySQL...
  8. Just execute the code on the clients side only. You probably want to create the marker on the client, and send the touch event off to the server so the server can check if the player isn't cheating or similar.
  9. Fair enough, on the storing side but what if I wanted to get every Sultan owner? On SQL I run a simple query that returns me a table with all players that own one, while like this I'd have to run a lua script that grabs every ones vehicles account data and then insert everyone into a table after going through all players...
  10. Except that you don't have full access to the integrated databases. Please explain how you want to efficiently store owned vehicles etc. with setAccountData and getAccountData. When using your own SQL database you can create a table for vehicles and a record for each vehicle...I don't even want to think about how you'd store a vehicle in account data. Let alone multiple.
  11. Maybe this or just implement it on your website instead, that's probably the better way anyway, people could just have the browser open in the background etc. Also there is no power going towards the game, which is not doing anything.
  12. I know your question has already been answered but I'd like to add to it. If you use a database or not really depends on what you want to. If you were to merely store a few values it would be way too much work, however since you asked for weapons, vehicles and the like a database is more or less a must have. You should also do yourself a favour and not mix the default MTA functions (setAccountData, getAccountData, ...) and your custom functions. Doing that will get messy really quick. The only functions I would maybe use are the account functions; e.g createAccount, ... that would allow you to use the integrated ACL. However you could also create your own rights system...needless to mention that is a lot of work.
  13. 1) Just use float3 colorrgb; in your shader, that should allow you to use dxSetShaderValue, you could also see the examples on the wiki for more details. 2) I suppose you are asking if you get problems when you call dxSetShaderValue in onClientRender events. Actually I'm not sure but I wouldn't call it more than really necessary.
  14. I think it's the comma in front of the where, so the mysql query line should be like this instead: mysql:query_free("UPDATE `characters` SET `etiket`="..mysql:escape_string(etiketLevel).." WHERE `id`='"..mysql:escape_string(getElementData(targetPlayer, "dbid")).."'")
  15. 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.
  16. You should establish a database connection when the resource starts and use that for all the queries.
  17. 3aGl3

    [BUG]META

    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...
  18. 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.
  19. 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.
  20. 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.
  21. The fifth and 6th byte of the model flags actually change the camber of the wheels.
  22. 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.
  23. I don't think you can rotate the wheels at all, because their rotation is engine controlled.
  24. 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.
  25. 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.
×
×
  • Create New...