Jump to content

NegativeIQ

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by NegativeIQ

  1. Do you know name of the algorithm? If you do post the name because its not that easy to make each number repeat only three times. Do you know name of the algorithm? If you do post it.
  2. https://community.multitheftauto.com/?p=resources&s=details&id=3716 And its just one function SetVehicleHandling with multiple "types" as parameter - see example on wiki.
  3. @AleksCorethen you have no choice but to send multiple queries. And by the way just so that someone doesnt say im wrong, there are some languages or plugins/extensions for "things/languages" that allow sql multi query but its highly discouraged since its more trouble than its worth and it actually quite hard to sanitize from sql injection. So in the end its like you dont have a choice but to simply send multiple queries (and its also easier to handle errors these way). Also considering that we are talking about mysql and how it works, when you send queries one after another and only change values it should reuse previous query cache so second one would be allot faster (but that could also depend on mysql configuration). Feel free to loop thru all players while using dbQuery, its a non blocking function (wont pause code execution while waiting for mysql response). And since you are just updating and dont care about result (there is none) just use dbFree right after dbQuery function. (check dbQuery wiki for more info)
  4. You can use same IN statement for update same way as you use it for select. UPDATE `race_stats` SET `Info`=2, `Info5`='SomeString' WHERE `playerID` IN(??) Since these topic is about tips, my tip is to always escape table and field names in mysql to avoid errors (see how i use tilde and single quotes in that code). Also escape any kind of user input.
  5. You wont find it as resource since it depends from car to car. And before i say anything you will probably need to uv remap models yourself. Also nobody is gonna make it for you. First glass texture has to be unique on vehicle, and that means it can not be shared with anything else (Ex: SA elegy shares same texture for lights and windows ). Second thing you need is a simple shader that replaces texture, in your case to RGBA color. By the way you can use find texture name shader from wiki to find out if windows are sharing texture with anything else.
  6. NegativeIQ

    Ped sync

    Hey folks, just a quick questions about peds (not players). If ped's sync interval is 400ms (default) is there anything else sent every 400ms except https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/CPedSync.cpp ? Also is every info always sent (like pos,velocity,hp,armor...) or just the ones that have changed?
  7. NegativeIQ

    Data and Wifi

    You cant, 3G router is located at some ISP tower and only they could do that but they wont since its a security risk, and you are probably sharing single IP with allot of people. If you need to test something with a few friends you could use Hamachi (free up to a 5 people in a single network - multiple network's are possible) and just use hamachi IP to connect to server, downside is that everyone needs to have hamachi to play but upside is a bit lower ping due to tunneling (dont think you will notice it).
  8. 1.Im pretty sure even 100000 collision shapes would not make your server/client lag. 2.If my logic serves me right. Collision shapes created on a client will trigger handler (callback) only on client side. And collisions created on server side only handler on a server. Since player has to send his information like position every few milliseconds to server server, server can perform its own check on server side so i dont think there would be additional data transfer. Also sending information from client to server about triggering something does not make server eat all the network speed. Problems are syncing things like position, animation, speed, camera...Things that are sent each few milliseconds. Calling a simple trigger can not impact on any server with a decent network speed, specially since its download and not upload.
  9. Hey folks, i know i can change textures with a shader. But can i replace model? And dont say to use replace dff function, it has to be with a shader.
  10. Did you even try to search? Here is one: https://forum.multitheftauto.com/topic/74025-rel-mod-downloader-v-121-out-now/
  11. Decided to mess around a bit so i tested code and everything is fine except that when you are looking behind projectiles are launched in in opposite direction from the turret.
  12. https://luac.multitheftauto.com change https to http. I think your curl does not support secured connections or it require some config.
  13. That does not seem right if you (your friend) did not change your elegy model. Take a look at these elegy template: http://www.gtagaming.com/images/mods/1298686778_elegytemplate.jpg.th?400x400 As you can see it should have taken effect on parts. May i ask you if you used shaders to change paintjob? That may explain why it did not take effect on a parts (but then again it does not since they all use same texture)
  14. You need to use a shader for that. Just google for mtasa shader texture replace. There is plenty of topics on these. And you can find texture name with https://wiki.multitheftauto.com/wiki/Shader_examples#Texture_names or simply just open TXD file and find texture you want to replace inside (i guess its faster since you gonna need to extract and edit it anyway) EDIT: Here is what you are looking for https://forum.multitheftauto.com/topic/30181-helpreplace-car-paintjobs/#comment-307119
  15. Select type to All files and save it as myserver.lua EDIT: Since you will be working with many files i suggest you to show file's extensions in windows. Just google it. Then you will be able to rename your files and their extension with a double click on file name.
  16. Mta uses lua and it compiles scripts on runtime so you dont have to compile anything in order to run it. That means you can use any textual file editor ( or IDE since that is correct term for what you are looking for) like notepad to script. Im myself suggesting sublime over notepad++, atom, brackets or anything else in fact. Brackets is/are nice for web development, specially design. While it can be used for anything just like most text editors i find it way to heavy since it uses chromium. If you have habit of closing editing program during testing or something like that avoid it at all costs. Also im not sure if it supports external compilers. Notepad++ is a very nice ide but i find it lacking many important and comfort things that atom and sublime has. Atom and Sublime are two best universal ide's you can find today. They both have huge variety of plugins for languages and other things, support compilers, provide themes, and much more. At the end it comes to your personal preferences but i find Sublime to be more friendly with almost everything. It has simple and somehow easy to remember shortcuts and possibly/probably/definitely more plugins then atom. Its also written in python but compiled to binary so its easy to write plugins for it and yet not to heavy like brackets.
  17. Checked code a little bit, and if im right its very interesting since it extends cegui rather than replacing it. But still downside is no docs and examples (i probably could find my way around but i still dont know if its worth it). So its safe to say im still looking for DirectX gui and suggestions are welcome. Offtopic: resedit looks like a VERY useful resource, i would add it to Scripting and Mapping Tools topic inside scripting board.
  18. Hey folks, could someone point me to some nice DxGui library? I have been searching forums and google for like an hour now and no luck. I mainly need it to create custom inventory system for DayZ, so GridList and Drag&Drop functionality is what i need mostly but i guess if library is good but it does not have that i could script it myself. Any suggestions are welcome, and by the way i have seen dxgui on wiki but it seems like its not finished and abandoned.
  19. You can learn to script, follow tutorials, read lua documentation, try simple things like spawning player, setting his camera, create vehicle, reserve that vehicle to certain player...That is how you start, not with some kick ass gamemode with 100k lines...
  20. How do you know which one you are actually moving? What i think is, you are actually moving them both, only you see second as its the last one rendered (over the first one at same pos) EDIT: note that im still newbie at lua and mta, so i may be completely wrong (not taht i dont know how to read the code)
  21. Cant say what is wrong but it looks like you missing car texture so my guess is that 562.txd is failing to load or something... (Did you try testing that mod in Single Player? - Just test vehicle without mods if you didnt yet)
  22. @Ab-47 file delete would have same effect as cache disabled (keeping file only in memory). @Citizen About meta and that topic ling, i think disabled cache parameter in meta is painless solution as it will have the same effect (keeping file only in memory), not what im looking for. But you did give me idea to try out, i could also place anomaly inside lua files, and use one small script that would be always downloaded from server (cache disabled, means only exists in memory), read client file(s), import into a buffer, remove anomaly and load using loadstring. (Just sharing my idea, hope someone may find it useful, or help me ) If i get some time and will to test it out i will share results, meanwhile any ideas, examples or simple experience sharing is welcome (Yep im that desperate ) EDIT: By the way anyone tested if these is gonna screw with decompiler(s)? omfguncompilable = {{{{{{},{},{},{}}}}}};
  23. setWeaponProperty ( 31,"pro","flag_anim_crouch", true ) https://wiki.multitheftauto.com/wiki/SetWeaponProperty weaponSkill: Either: "pro", "std" or "poor". The player must have this skill level set to have the effect. Instead of using setPlayerStat and improving weapon accuracy for given ped (can make game a little unbalanced), just use right weaponSkill as it was meant to be used. Above example (posted by: KariiiM) is for PRO skill. Just set same flag for each one of the thee skill levels (pro, std, poo). I never used these function but wiki says it all...
  24. A simple question, how to protect your client side resources from being stolen? First thing first. I know about cache tag and its not solution in my case (well i could use it for a few important scripts but nothing more) Lua scripts could be compiled (but that wont do any good as there is/are decompiler(s)), so any tricks to screw with decompiler(s)? How to protect TXD,DFF,COL,image (as in png,jpeg...) files? One thing that came to my mind is placing anomaly inside files, and removing it just a moment before import, or completely encoding file, base64 or something like that, maybe even encoding and placing anomaly. But im afraid these would update last modification timestamp and client would ask to redownload those files next time...I dont know how MTA check if file was modified so any help on these is welcome.
  25. Hello everyone, 2-3 days ago i started playing with MTA and Lua, and i like it (after samp its not hard ) Anyway i noticed that OOP here is a bit strange (at least to me). Usually if some language is OOP it can handle everything in both ways (procedural and oop). And if im right here it is not the case (we cant mix up two in same resource) So some good examples would be nice, or resources i dont mind as i mostly need to learn syntax (dont send me to wiki, that i already checked). Also if someone can clarify something about OOP docs. bool forcePlayerMap ( player thePlayer, bool forceOn ) OOP Syntax Method: player:forceMap(...) Variable: .mapForced Pair: isPlayerMapForced From above, as i can understand i can use: player:forceMap(true/false) (as static method call in most oop languages) player.mapForced (Just directly access variable (set and get) instead of calling forMap set method) player.isPlayerMapForce (As get method) Im right or completely wrong? If im wrong please give some examples... And if someone could provide some examples on how different resources can communicate with each other, if possible in OOP style. EDIT: Oh and if possible some examples on custom classes and class inheritance in Lua. Thx in advance
×
×
  • Create New...