Jump to content

AlexTMjugador

Discord Moderators
  • Posts

    138
  • Joined

  • Last visited

Everything posted by AlexTMjugador

  1. AlexTMjugador

    Help me URGENT

    Some of your server resources are calling functions that are only available in the MTA-MySQL module. Be sure that you have installed the MTA-MySQL module properly. Installation instructions are in the link I provided. That will fix your problem, but I would recommend you to update your resources to use the built-in database functions nevertheless, as they are actively developed, easier to handle and don't rely on external modules.
  2. I think there is no hard limit in what can toJSON return (and if it uses char* strings in its C++ implementation, which is probable, I can tell you that there isn't any limit). However, keep in mind that RAM, storage and CPU power are limited resources: if your toJSON call produces a 1 GB string, it will take more than 1 GB in RAM to store it, doing any operations with it will take time and saving it to a database may be impossible or be impractical, depending of the limits of the DB software you are using. When working with large amounts of data the optimal thing to do is dividing it in smaller cunks which can be stored and processed without any problem.
  3. The "last touch" he was talking about were things like preparing more clothes to be usable with the script, fixing bugs and adding minor changes or features. Nothing very fancy Currently, the script shown in the video is in a pretty finished state and is available for use by every player in our server. Yes, but normal ped skins aren't able to produce such a rich variety of clothes in the same character. You are limited to their original morph, so you can't put so many own clothes on it. The best thing you can do with normal skins is attaching custom objects to the player, like SA: MP does, and that does not look very well if you want your players to pick their shirt, trousers and shoes.
  4. Metatables are just tables with special fields. When they are assigned to another variable by using the setmetatable function, those special key-value pairs modify how does Lua interact with the original variable. In pure Lua it is only possible to modify metatables of tables, however. If you look at it without paying too much attention, metatables seem like advanced stuff which is there to complicate things and not provide any new possibilities. But you should look again at it: metatables are the only way we have in Lua to achieve proper Object Oriented Programming, and only that alone should be an important enough motivation to learn what metatables are. Besides OOP, metatables are also useful for intercepting table reads and writes (the setTableProtected useful function is possible thanks to them, and the exports.resource:function(...) syntax too), making things clear for big scripts, when hiding away details of some implementation is preferred, debugging... Sure, metatables are something you won't need to use everyday, but in the long term they become a necessity because you will want to tidy and clean up your code. There is more information about metatables available here, in addition to a list of special fields a metatable can have.
  5. Even after visiting the two webpages you linked to, I didn't see any way to buy your servers (unless you have to do that using Facebook, which is something I find quite lame). Seems legit... Besides that, can you post some more specifications of your servers? Being able to buy a server which can hold up to 200 players for 1$, without knowing its CPU and RAM specifications, doesn't inspire me any confidence in your services. It is so cheap.
  6. AlexTMjugador

    new weapon

    It is not possible to add truly new weapons to MTA: SA, because there are no scripting functions for that. However, it is possible to workaround that to a certain extent by creatively using the functions we currently have. Firstly, you have to think about what kind of weapon do you want to "add". Is it a sniper rifle? Is it a rifle? Is it a shotgun? The most important thing here is that you select a weapon type you can emulate by using the weapons that GTA: SA already has. Thanks to the createWeapon function, you can create a dummy weapon with unique accuracy, damage and range which shoots like an existing one, but has different properties that can give the illusion of a new weapon. Great! We have now a dummy weapon that is like a new weapon! But how do we make the player shoot it like a normal weapon? This is the most complicated part, but I don't think that is way difficult either. You can give the player an existing weapon to aim, but instead of letting him shoot it as normal, intercept that and shoot your dummy weapon instead. Of course, your dummy weapon must face the point the player is aming to and be in the player hands, and you can achieve this by using a similar approach to the bone-attach resource, for example; that is, some maths. If you want the player aiming reticle to look nice, you can play with skill levels and setWeaponProperty with the weapon that the player is really holding. Now you may be wondering: Hey, but won't this look ugly? The player will hold like two weapons at the same time and in the same place! Yes, you're right, that will happen and it looks ugly indeed. But remember the TXD and DFF replacing functions that MTA has, in addition to shaders. You can make the weapon that the player is really holding invisible with them, and let the player hold a third weapon which is nothing more than an object which represents the desired new weapon you want the players to see. To make the dummy weapon invisible you don't even need these functions: setWeaponFlags is enough. If you want to, you can script custom shoot modes or features for the new weapon, so in the end it will look pretty convincing. But of course all of this is easier said than done, and you need a decent scripting ability to do something playable and nice. I exposed and answered the main questions you can came across when scripting this, but writing the code itself is up to you.
  7. I won't, I don't like adding unknown people to Skype. Sorry. I tested again the script under various FPS limits (25 FPS cap, 50 FPS cap and 100 FPS cap) and it works just fine. Check that you have defined the script as clientside in the meta.xml file, like this: <script src="script_name_here.lua" type="client"/> Other than that, I don't really know what could be preventing the code from doing its job in your computer (providing that you know what a resource is and where to put that code, of course).
  8. The code structure I posted works, but for some reason the animation isn't applied properly and therefore it seems that the script is not working. However, using a timer properly seems to fix this. Try this code: local wasSprinting local function antiBunnyHopping() local moveState = getPedMoveState(localPlayer) if moveState == "sprint" then -- The player is sprinting wasSprinting = true return elseif wasSprinting and moveState == "jump" then -- The player was sprinting and now jumps. Don't let him do that by applying an animation -- (Delaying the animation a bit seems necessary to achieve the effect we want) setTimer(setPedAnimation, 50, 1, localPlayer, "ped", "FALL_collapse", -1, false, true, false, false) end -- If we get here, the player is not sprinting, so take that into account or the next frame and remove animations if we should wasSprinting = nil end addEventHandler("onClientPreRender", root, antiBunnyHopping) It blocks the player from sprinting and jumping altogether, but you can modify it so it suits your personal preferences better. For example, you could let the player jump some times but block them from doing so if they do it too much, or things like that.
  9. Your code has a syntax error and it won't work even if you fix it because getPedMoveState can't return two different values at the same time. Use something like this instead: local wasSprinting local function antiBunnyHopping() local moveState = getPedMoveState(localPlayer) if moveState == "sprint" then -- The player is sprinting wasSprinting = true return elseif wasSprinting and moveState == "jump" then -- The player was sprinting and now jumps. Don't let him do that setPedAnimation(localPlayer, "ped", "FALL_front") end -- If we get here, the player is not sprinting, so take that into account or the next frame wasSprinting = nil end addEventHandler("onClientPreRender", root, antiBunnyHopping)
  10. I don't know what resource you are talking about, but you can use the following scripting functions to achieve the effect you describe pretty easily: getPedMoveState -- To get if the player is running/jumping/falling/whatever toggleControl -- To block the player ability to jump and/or move and restore it setPedAnimation -- To apply a falling animation if you want to By the way, that special world property is related to additional bike jump height and NOT to jumping over and over while running to go faster.
  11. Si no quisieses buscar "líos y mierdas" no harías este tema en primer lugar, pero bueno. En este caso no estoy muy de acuerdo con lo que Shiro hace, pero si te metes en la boca del lobo es normal que asome las orejas...
  12. Mientras sea un lenguaje Turing completo y tenga las librerías suficientes, cualquier lenguaje sirve. Incluso podría haberlo hecho con Lua si se lo propusiese.
  13. AlexTMjugador

    Packet loss

    No problem Server CPU and memory usage weren't influenced by packet loss, I guess. Anyway if Windows server gives less problems to you there is nothing bad in using it instead of Linux. Nowadays Windows Server is pretty stable and well suited for reliable servers.
  14. AlexTMjugador

    Packet loss

    That screenshoot on Windows Server 2012 looks definitely better than the first one, in terms of packet loss. However, you can't expect packet loss to be 0% in a popular server like yours, because providing that there are >150 players online, there is the possibility that some clients could have a network problem at their end. For example, players in Egypt are known to have some trouble playing MTA: SA. Like I said, I would recommend you to talk about this with your hosting provider, so they can check where is the fault. In addition, you can also check your packet loss per player, considering their country and ISP, so you can track down the problem further or at least have some insight of what is exactly happening. Finally, it could also be an issue with your new installation of Linux, so you should double check that the built-in HTTP server is working fine and the operating system and programs are all well configured.
  15. Use a table visible to the handler function (that is, declared in the same scope as register_newEvent) to store in it the processor functions for each event, and then let the event handler read the function from the table. You need to keep an eye in that table not growing very large though, but I don't think that's a problem.
  16. ¿Y cómo se supone que ese evento ayuda a combatir el lag? Si tienes scripts que llaman un montón de eventos al subirse un jugador a un coche, o bien hacen tareas computacionalmente exigentes, da igual aplazar eso a un momento anterior o posterior, porque lo tienen que hacer igual. Por otra parte, si la causa de ese congelamiento breve es el propio cliente de MTA: SA o el servidor, tampoco creo que consigas evitar el problema inicial ya que no vas a impedir que el juego haga eso tarde o temprano.
  17. Cual es, donde esta.? Está al lado de "home", en los enlaces de arriba del todo de la página, donde pone "irc chat". Aunque si sigues sin verlo puedes entrar a él haciendo clic aquí también.
  18. You are probably experiencing some kind of event number transfer precision issue. I believe that this is the same issue that makes MTA: SA editor save numbers with a ridiculously high decimal count, even if you only use two or three decimals. You can workaround that limitation in two ways: Treat the number as a string, and transfer it to the client as a string. Let the client round the K/D ratio for display, instead of the server.
  19. I think that a purely realistic Roleplay server should not need any in-game staffs or rules in the first place. In the real world there are no "overwatchers" who can teleport things around and tell people what they can and can't do. But of course that is some sort of an utopia, because it would need a completely bug-free gamemode, it would require players to play by the rules even without staffs' invervention and roleplay is a kind of difficult gamemode to learn without luck, time or the proper people to teach you (which usually are staffs). In fact, nothing can be truly realistic in MTA: SA. I mean, this is a computer game which doesn't and can't simulate every single thing that happens in the real life. Realism here is just a matter of opinion and priorities: sure, you can script your own car engine system according to real world physics and that kind of things, but you won't be able to replicate the entire universe in your PC and hope that it will be playable (or even hope that our current science laws are fully correct). You can try to achieve the maximum realism possible, but eventually you will always want more. Even if you find vG a realistic roleplay, I'm 100% sure that there were people who suggested ideas to make it more realistic. What I'm trying to say here is that things like "serious" roleplay servers don't exist. Roleplay is a vague and wide concept, and its defining characteristics can only be reduced to a gamemode in which players take the role of a person. And there are a lot of different ways to do that. Some are more involved than others, in the sense that they are more demanding for the player and interpret more aspects of the person they are taking the role of, but you will never get rid of the limitations of a videogame in the process. The player makes decisions, but if the character was real, would he make EXACTLY the same decissions too, and feel the same way the player thinks? All in all, I understand what are you trying to say when you talk about a "serious" roleplay server, and I agree with you, but I find it quite utopic. It is just impossible to make a server in which everybody will feel like they would be another totally different person, and act like they were without taking into account every kind of Out Of Character opinion or knowledge. But that doesn't mean you can be pretty close to it with enough effort, so I look forward to that.
  20. What number are you trying to round? Rounding 0.56 under default parameters works fine for me.
  21. AlexTMjugador

    Packet loss

    When did this started to happen? Have you told your hosting service that you are experiencing a packet loss problem? From my own experience, the most frequent cause of packet loss is some kind of hardware or networking problem or limitation, so I don't think MTA has something to do with it. Anyway, you shouldn't be worried that much about some packet loss if it doesn't affect your players, availability or bandwidth. It could just be that your network is discarding some traffic that it thinks it is unimportant, and sometimes it fixes itself after some time.
  22. You need to pass the processor function in the event trigger, like you pass data, because I think that in your event handler MTA: SA tries to access to a value which is no longer in the environment.
  23. Es bastante probable que lo que dices se trate de un bug en MTA: SA. Lo reportaron varias veces en Mantis, en las incidencias #6479 y #8751.
  24. Firstly, you are asking for support for a resource you shouldn't be using or modifying because it is made by a server which doesn't want you to do that. Secondly, I think this is the wrong section to ask for help in scripting. We have a Scripting subforum. Thirdly, are you complaining about FFS banning you? Providing that you are stealing their scripts, it shouldn't be a surprise to you... Besides that, MTA will not unban you from that server because that is entirely your fault for doing naughty things with their code, and server owners are free to ban everyone they want to even if it is not fair. So I don't think that we are going to help you with that, sorry. Next time use resources you can freely download or, better yet, script your own
×
×
  • Create New...