Jump to content

koragg

Members
  • Posts

    730
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by koragg

  1. koragg

    Question

    @TorNix~|nR you want to disable chatbox binds (made with /bind + say hi for example) or what? Because if you see what 'guiSetInputMode' does on it's wiki, it's not that.
  2. @IIYAMA status1 = 641 & status2 = 14 when I start your test script. If that means what I think it means then I better start replacing all 'false' to 'nil' when removing elementData Yes, but on client-side I can only make it 'nil'. And by 'performance wise' I meant which is better for less system strain, 'false' or 'nil'
  3. I just wish that this would get clear to me once and for all I have a lot of times something like setElementData(localPlayer, "data", false) whenever I don't need the particular element data anymore. Now my question (for months) has been - is it better to use setElementData(localPlayer, "data", nil) instead? I'm talking performance wise here. I've used elementData A LOT so maybe it can cause some lags if not used properly, idk.
  4. Someone has stolen my Online Radio script, edited it a bit and re-uploaded with no trace of me as an author. Mine: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14001 Copied: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14719 If you open client.lua you'll see that literally everything is the same as mine, he just translated the text to turkish and added a turkish station (or just Turkey as a new radio location). I don't have anything against people using my scripts, editing them and whatever...but uploading as their own - just no. DONE
  5. Seems fine for now. And avoided one trigger, thanks for the tips guys
  6. Won't do because that would mean that paintjobs only get updated when someone logs in. What if i join alone and two guests join after me. They won't see my paintjob as the function wouldn't have been triggered because there was no login to trigger 'onPlayerLogin'.
  7. I'll try this. Doing it 'onPlayerJoin' gives a bug which I'm lazy to investigate and fix
  8. Yeah, I was wondering if I should use 'onPlayerJoin' yesterday. Guess it will be more efficient that way.
  9. This function actually just makes sure that every player's vehicle is wearing the paintjob saved to that player's account, hence the infinite low timer. I load/unload the paintjob the way you mentioned in your 2nd question whenever a player clicks on some GUI stuff to select/change their PJ. But I couldn't figure out another way to keep all paintjobs synced with everyone else other than this one. The elementData is only used to transfer the account data to the client side. The check you're refering to is to see if a logged out player still has a paintjob and if so to remove it from their vehicle.
  10. It works as it should. I have constant 50 FPS (server's max) and don't get lags...but I still wanted to ask - is the below implementation badly done or it's ok to leave it like it is? function onResStart() setTimer(updatePJs, 300, 0) end addEventHandler("onResourceStart", resourceRoot, onResStart) function updatePJs() for i, player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account and isGuestAccount(account) then if getElementData(player, "paintjob") then triggerClientEvent(root, "unloadVehiclePaintjob", resourceRoot, vehicle, tostring(getElementData(player, "paintjob"))) end return end if account and not isGuestAccount(account) then local vehicle = getPedOccupiedVehicle(player) local paintjob = getAccountData(account, "paintjob") or "NoPaintjob" setElementData(player, "paintjob", paintjob) if vehicle and paintjob then triggerClientEvent(root, "loadVehiclePaintjob", resourceRoot, vehicle, tostring(paintjob)) end end end end I can't make it work without the infinite timer but, still, I want to see what more experienced devs than me think about it
  11. When you use fileDelete at the end of every single client file that would mean that players need to download ALL those files every time they join your server. And that can get some huge MB sometimes. I'll never see the point of "protecting" scripts in MTA. If you got paid for it then ok but it's just for fun here. Plus if some *beep* uploads your script and says it's his the mta staff will find out and delete his copy. There's a "Report resources" topic around here made specifically for this reason
  12. Ghost-Spectate The past months I started working on something that may change the way you train for clanwars forever. It's a resource which, in my opinion, should be included in the next version of MTA as a default resource just like race_ghost is. I present you my biggest work to date, (almost) all made from scratch - race_ghost_spectate. Functions: * The original race_ghost resource is required to be on the server and running. * When a map with a ghost racer available gets started all you need to do is press G to spectate the ghost vehicle. * You cannot spectate the ghost vehicle until the race countdown ends. * You can only initiate ghost spectating when you're in 'alive' state. * As long as you're spectating the ghost vehicle you cannot switch directly to normal spectating. * Your state gets set to 'nolifing' while you're spectating the ghost vehicle * You can move the camera freely around the ghost vehicle. * Q, E, Q+E or middle mouse button all work as expected: look left, look right, look back of the ghost vehicle. * When the ghost vehicle has hit the finish line you cannot start spectating it. * If you press Enter while you're 'nolifing' you will stop spectating the ghost vehicle and will respawn as normal in 'alive' state. * If you're spectating the ghost vehicle and it hits the finish line when you're not alone in the server you will switch to normal spectate mode automatically. * When you let go of the mouse for 1.5 seconds it will go back to being behind the ghost vehicle automatically. And it will always follow it, on all axis. * When you start spectating the ghost vehicle everything will move according to it: - The checkpoint markers and blips will be displayed ahead of it as if it's you who's driving the vehicle. They'll also dissapear when the ghost collects them. - There will be a white-ish line drawn a few meters ahead of the ghost vehicle. This line shows where exactly it will go next. - There will be some information regarding the ghost, like it's current checkpoint as well as the name of the player who did it, shown at the bottom center of your screen. * The following commands are available so that you can turn on/off anything you may want. 1 = on, 0 = off: - /info 1 or 0 - Enable/disable Ghost-Spectate's ghost creator name and current ghost checkpoint at bottom center of your screen. - /route 1 or 0 - Enable/disable Ghost-Spectate's route highlight feature which draws arrows a few meters ahead of the ghost's current position. - /blips 1 or 0 - Enable/disable Ghost-Spectate's checkpoint radar blips which adds blips for the two incoming checkpoints ahead of the ghost itself. - /markers 1 or 0 - Enable/disable Ghost-Spectate's checkpoint markers which adds markers at the spot where the normal checkpoints should be. - /timesup 1 or 0 - Enable/disable the next map vote when the ghost vehicle hits the finish line while you're spectating it and are alone in the server. * All of the above commands get saved into a xml file so they get loaded back when you reconnect to the server. No need to enable/disable them each time. DOWNLOAD HERE
  13. Love how you talk to noobs not willing to learn man xD

    1. IIYAMA

      IIYAMA

      I just don't take them serious. People that only want to take, are most of the time the worst people in the world. Yet, I only accept supporting them if they show some motivation. Which is executing instructions.

       

      Thx for the compliment mate.

      Unfortunately words can be must understood and they can go on a rage mode, which I prefer to prevent. Not good for my mood.

    2. IIYAMA

      IIYAMA

      misunderstand*

  14. Found it In race_server.lua a function called "function raceTimeout()". Thanks to this post. Just had to add an event to it and then trigger it.
  15. As the title says - how can I make the time left become 15 seconds (without all players having finished) without actually waiting for it to happen naturally (force it)? I'm talking about the race gamemode btw. I just can't remember/find how this could be done (but I know I've seen it long ago somewhere around the files, just idk what to search for now). Example of normal occurance: All players finish (or the ones that have not finished are in 'Spectating' mode) - timeleft becomes 15 seconds (doesn't matter what it was before that). I need to make this work in my resource but don't know the name of the event that I need to trigger or of the function I have to use. Help, please
  16. If you play MTA then there's always that guy who you've seen at some server who knows someone whose cousin's brother's nephew knows some sort of scripting. And that guy probably knows other guys who know scripting. Don't hurry to give your money just yet. Maybe someone will do it for you for free. I know a lot of lua scripters all thanks to simply playing MTA. We all help each other for free. Good luck
  17. I've never worked with tables that much to be honest. Just wanted to try optimise my server a bit for potato pcs. But will try this, sounds good to know for my university, even though it's C++ there.
  18. Good thing I asked before editing lol Guess I'll leave things as they are.
  19. Hey again, can someone say if these loops are identical? local t = {} for k, v in pairs(theTable) do if type(v) == "table" then t[k] = table.copy(theTable) else t[k] = v end end local t = {} for i = 1, #theTable do if type(theTable[i]) == "table" then t[i] = table.copy(theTable) else t[i] = theTable[i] end end I want to make all loops like the second one to get better performance but am not sure if they'll function the same. Would it be worth it to edit all 'for' loops of my server's resources (around 100) or performance would still remain the same in reality? They only go through small-ish tables, nothing huge.
  20. I got confused a bit He's mixed up redirecting all players and redirecting one player in the code. If everyone will be redirected why is the last outputChatBox needed? And yeah do as the guy above me said @Lorder.
  21. I use it for exactly the same reason
  22. I'm using it in a lot of places and it's fine. I guess if you set an infinite 50ms timer and try to setAccountData inside of it it will lag but...c'mon who would do that? In normal usage it's fine.
  23. @Lorder try this: function redirect(player) setTimer(function(target) redirectPlayer(target, "91.121.70.169", 22017) end ,5000, 1, player) outputChatBox("You will be moved to the other server in 5 seconds...", player) outputChatBox("Player "..getPlayerName(player).." has moved to the other server!", root, 250, 255, 0, true) end addCommandHandler("go", redirect)
  24. I don't get it... yesterday it didn't work. It showed 0 markers and they stayed untouched. I did the same thing today and everything's fine ._. what
×
×
  • Create New...