Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 24/02/22 in all areas

  1. The second function has a problem returning the occupied vehicle, I don't know if that could be the cause of the problem you are having, or is that just a typo while you were writing the examples on forum. function toggleLights(playerSource, cmd) local vehicle = getPedOccupiedVehicle(playerSource) -- use playerSource instead of thePlayer, thePlayer is not defined so this will return an error and toggling lights won't happen if (vehicle) then Yes, this would cause lag and lots of unnecessary data flow. You don't have to get a mysql result everytime you lock/start a vehicle. If I were doing toggleLock and toggleEngine functions for vehicles, I would just simply use them when a player types a command / presses a key, as you are doing, inside those toggleLock and toggleEngine functions simply use setVehicleLocked and setVehicleEngineState like function toggleLock(vehicle, state) if not vehicle then return false end setVehicleLocked(vehicle, state) return true end For the command you would do function lockCommand(player, command) local vehicle = getPedOccupiedVehicle(player) if vehicle then toggleLock(vehicle, not isVehicleLocked(vehicle)) end end addCommandHandler("lockveh", lockCommand) Keep the actual toggle functions seperate from the command functions, that way it will be easier for you to see, utilize and use those functions later as well. Then have a different save resource or function to save the data to mysql. You can make a timer every 5 seconds to call the saving, and inside the save function you would get every desired vehicle and their state of engine and locks to update mysql data with the new ones. This would make data usage and network flow much more less in my opinion, other than calling for mysql everytime a player types a command; imagine if they start spamming. Of course you can make anti-spam checks, but overall that way would be much more inefficient. Also there is a resource that you can use to check the usage of resources: performancebrowser - Multi Theft Auto: Wiki I believe it is already included in default MTA resources.
    1 point
  2. Hi, welcome to the forums! From my understanding of how serials work, also based on the information provided on the wiki here, "they aren't only based on hardware, but more". This, of course, means that your serial is not only bound to the disks you're using, but it actually takes into consideration other software and/or hardware related information. Again, from what I can gather, the fact that MTA 'synced' your serial to also take into consideration your secondary disk seems to be the right thing to happen. Such actions as reinstalling Windows will, as you have already found out, have no impact on your serial.
    1 point
  3. Hi, welcome to the forums! Please download and run MTADiag and follow the instructions, then post here the link you are provided with so we can get a better idea about what might be happening.
    1 point
  4. Yes, everytime getElementsByType is called, a new table with the current players is created.
    1 point
  5. Just tested it with another person and it works, thank you so much! But then, this table solution it's dynamic? I'm not too good for some english concepts, I just want to know if this add "new players" in the list, because I don't think that this command should keep static information... I'm sorry if you already explained it, I don't get some words
    1 point
  6. The player-list is dynamic, it does not seems to be a worth option for your user-case. It is only an option when the list is static, so no new players. -- function ( playerSource, commandName ) local playerList = getElementsByType ("player") for index, player in pairs(playerList) do if player ~= playerSource then end end -- end
    1 point
  7. An "easy" alternative would be to use elementData to set a value and check this value on the client side with getElementData
    1 point
  8. Just compare each player with the player you do not want. Filtering is only beneficial when you keep that table for a longer period of time/repeat usage. -- loop start if player ~= otherPlayer then end -- loop end
    1 point
  9. My library can do that, if you really want to be able to do it that way.
    1 point
  10. unfortunately you can't do this by default but you can run it on server side with "triggerServerEvent" and then pass the return value back to client side with "triggerClientEvent"
    1 point
  11. maybe you can do it like this to accept the animation of others entering the car function blockExit(exitingPed, seat, jacked, door) if(isVehicleLocked(source)) then if(not jacked) then --cancel if car is not jacked cancelEvent() end end end addEventHandler("onVehicleStartExit", getRootElement(), blockExit)
    1 point
  12. 1 point
  13. Can you try using the ignoredElement parameter processLineOfSight(px, py, pz, tx, ty, tz, true, true, true, true, true, false, false, false, localPlayer)
    1 point
  14. @Dol The ban is removed, because you reinstalled Windows to successfully get rid of that spoofer's effects. If you won't be a gamecheater in the future and thus dont feel the need to use spoofers that mess up things in your PC, you wont risk similar problems.
    1 point
  15. 1 point
  16. So i know this is probably a massive shot in the dark given the state of the English community but: I'm looking for various staff members for a large light RP/RPG project I'm working on. This project is the product of my nearly 10 years of both roleplay and freeroam experience, and i'm solely building it to A. expand my coding knowledge and creativity and B. spread word of MTA to people that love SA had no idea it existed. With that being said, I'm not looking for a massive playerbase but if one happened to find me i wouldn't mind either. I like to type way too much lol, so please take the time to read as it's all informative to the project, thanks. A little about myself: Most people that know me know me from roleplay (and a couple OGs from freeroam) and know that I ran or co-ran a handful of RP servers that lasted some time, as well as mapped quite extensively for RP, including my Kota Islands map (https://youtu.be/nFUy1UcFgHs). I spent a long time brewing up ideas since my start in roleplay in 2016 and freeroam in 2013-2014 and applying those ideas to different servers, but in the end i never really made what I thought was the perfect idea of a server. Now that English RP is dead and the English community as a whole is declining, I figured I'd make my last server and continue to work on it or at the very least keep it running until MTA itself closes its doors. That's not an empty guarantee either, I have no problem making and keeping a completely self-sufficient server online that can run on it's own when I get busy with life. About the server: Read the spoiler after this next sentence, because I know how some of you get with this but I think the reasoning is valid enough. The server in itself uses an unreleased version of the 2020 owl code given to me from an old Owl developer friend of mine. We've modified it heavily over time to more suit our server's needs. Now why the Owl code? Ill keep the reasoning as a spoiler so i don't spam up this post lol The Grid System: Our server features a system originally started by Exciter that allows you to travel to anywhere you can think of outside the SA map. The original owl code has a folder called 'Grid' with one single file in it and that's all owl got before Exciter left the dev team and continued the feature on his own. I'm currently the only other person with a copy of the full system. Click the spoiler for a better explanation Map Completion and liveliness: Honestly, I'm tired of playing SA and not feeling like you're actually in a city, or in the woods, or in the desert and so-on. Below is a short list of a just a couple things i'm planning to do to make the city more immersive: There's really just so much to say about this server and I'm starting to ramble so I'll get to the point and say we're looking for anyone that wants to help with literally anything from coding, mapping, custom vehicle handling management, interior making (in-game not mapped), ideas, planning, administration and whatever else... or honestly even just another follower. The only things I require as staff are: - You're trustworthy (Meaning I feel like i can trust you, not other people vouching for you) - You're able to understand this is a long-term project and a large playerbase is not expected, but welcomed if it comes. - You're willing to stick around for the long run (obviously some lack of activity is no issue if you have school or other important life things) - You understand this is not a paid project, but I do pay our developers when I have the available funds to do so. I really shouldn't keep typing, so just message me on Discord if you'd like more information or are interested in helping out. 5150#5150
    0 points
  17. Good server but awful management. Admins like Tidvennu or moderators like Temezka insulting players without any kind of reason. And a server admin that complies with all that and don't tell them to act like admin or moderators and ban or kick if someone breaks the rules, instead of insulting back, mute etc. And everytime a player do a report, it's accused of being an "whining bitch", a "dumbass", a "mother:Oer", etc. There's logs to prove it. I don't recommend it for those who want have fun without arrogant admins and moderators.
    0 points
×
×
  • Create New...