All Activity

This stream auto-updates     

  1. Past hour
  2. Patrick

    Command

    local IP = "127.0.0.1" local PORT = 22003 addCommandHandler("redirectall", function() for index, player in ipairs(getElementsByType("player")) do redirectPlayer(player, IP, PORT) end end)
  3. Thank you for clarifying 🙂
  4. ~Sr.Victor

    Command

    I put it, but when I activate the mod the players are already redirected.
  5. Patrick

    Command

    Of course, just replace the custom-event to addCommandHandler in your code.
  6. ~Sr.Victor

    Command

    Is it possible to put a command for players to be redirected?
  7. Patrick

    Command

    And what is the question?
  8. @majqq Keep in mind that even if there is no data added, the triggerClientEvent it's (5x?) packet size is bigger than that from setElementData. And triggerClientEvent is also a lot faster and therefore it's data rate is higher, if no buffer is used, it will cause blocking the network a lot faster than with setElementData. So if you broadcast to all players, triggerClientEvent might not always be the best option, because you do not reduce data. triggerClientEvent Fast data rate / requires a slow interval Run code directly / (with elementdata that is only possible for the second time you set the data) More secure No auto download for new players Specify target players* *Before the beta from below. There is a new function available in the beta for element data, that will help shrink the data usage of players that do not need the data. https://wiki.multitheftauto.com/wiki/AddElementDataSubscriber More information here: https://wiki.multitheftauto.com/wiki/SetElementData
  9. ~Sr.Victor

    Command

    I wanted to place a command to do the redirection, and not as soon as it activates. Because I have a separate event server, and I need players to return to the official with a given command. local IP = "" local Porta = addEvent( "redirecionar", true ) addEventHandler( "redirecionar", root, function (player) for index, player in ipairs ( getElementsByType ( "player" ) ) do redirectPlayer ( player, IP, Porta ) end end )
  10. Today
  11. If you could go with tables, then do it. From my own experience, i'd say that tables are way more efficient rather than element data. However you should remember about few things, when it comes to passing data (doesn't matter if it's element data or tables). 1) How often data is passed - the less - the better (use timers for reduction, aka buffers; collect pack of data, and then send it after 100-200 ms). 2) How much data do you pass - if you do not need to pass whole data, then don't do it (unless on init). Send certain values. 3) How you pass data - it should be well maintained to avoid issues. With tables it's easier to do. Haven't using using element data for a long time, but i'm pretty sure that: setElementData(client, "data", true) -- equals to 1 triggerClientEvent So every call of element data is one trigger, which is pretty bad. Imagine that you need to set 30 data at once (feels bad). You can see that tables won here local dataTable = {} local playerElement = getPlayerFromName("SERIOUSLY?") dataTable[playerElement] = {} dataTable[playerElement][1] = "First index." dataTable[playerElement][2] = "Second index." triggerClientEvent(root, "onClientDataSync", resourceRoot, dataTable) -- 1 call setElementData(playerElement, "First index", true) -- 1 call setElementData(playerElement, "Second index", true) -- 2 call -- Element data will trigger separately for each call. 4) Don't do those: local players = getElementsByType("player") local playerElement = false for i = 1, #players do playerElement = players[i] triggerClientEvent(playerElement, "onClientEvent", playerElement) end This will cause that triggerClientEvent will be called * count of players. Instead do: local players = getElementsByType("player") triggerClientEvent(players, "onClientEvent", resourceRoot) Since triggerClientEvent accepts table of players. And it would be just one call. Extra code to test by @IIYAMA. local sendingDelay = 100 -- ms local fps = 60 local timeSlice = 1000/fps local dataReduction = sendingDelay/timeSlice print("~"..(dataReduction - 1 ).." x times LESS per "..sendingDelay.."ms") You can see how certain delays affect server when passing data. If you have any other questions, feel free to ask. PS: Recently element data got some update with subscription mode, but i still advice to go for tables if you can
  12. I was playing Multi Theft Auto as usual, when I tried to enter one day, I said, "Disconnected: MTA Reason: You are banned by SHAPPEX. '' He works with a problem. I was banned from, I would be very glad if you could help. Serial: DCCD232FF141C88396A5033169C1EF42
  13. WIKI

    Yesterday I added my first wiki page. Which is not necessary something you call 'news'. But it was a lot of fun figuring out how the interface actually works. It is to be honest not very beginner friendly, even though there is a lot of documentation added. documentation

     

    The page/function which I added to the useful functions list:

    https://wiki.multitheftauto.com/wiki/CheckPassiveTimer

    This useful function allows you to use passive timers in your conditions. For example you want to prevent players repeatedly using a command.

    I named the function 'checkPassiveTimer', not sure if that is the best name for it, since it it does SET, CHECK and UPDATE, (+ Clean up cycle), depending on the situation. Checking is what you expect it actually does, so I picked that one.

     

    addCommandHandler("candy", 
    function (player)
    	if checkPassiveTimer("candy timer", player, 5000) then
    		outputChatBox("YES, EAT!", player)
    	else
    		outputChatBox("NO CANDY FOR YOU!", player)
    	end
    end)

     

    Does anybody have any suggestions/idea's/🐛? Or more experience than me with the WIKI + suggestions or improvements for the format?

  14. i Have a Costum Roleplay GameMode Whith All my Work in it
  15. It's not a false positive, but I won't give you any information; you know exactly what you did.
  16. theFOUR

    mysql

    [12:13:16] WARNING: account/s_login.lua:23: Access denied @ 'getPlayerIP' [12:13:32] WARNING: account/login-panel/server.lua:228: Access denied @ 'getPlayerIP' [12:13:32] ERROR: mysql/connection.lua:219: bad argument #2 to 'mysql_escape_string' (string expected, got nil) [12:13:32] ERROR: mysql/connection.lua:219: bad argument #2 to 'mysql_escape_string' (string expected, got nil) [12:13:32] ERROR: account/login-panel/server.lua:229: call: failed to call 'mysql:escape_string' [(tail call)] [12:13:32] ERROR: account/login-panel/server.lua:229: attempt to concatenate a boolean value how do i fix this?
  17. I think this ressource is simple That's My opinion and That Price Is A lot For it i guess a 2 $ or 3 $ will be good
  18. There are several ways to do it. One, if you use ped's camera rotation to rotate the minigun. Basic example: -- SERVER createVehicle(getVehicleModelFromName("Bobcat"), 0, 5, 3) addCommandHandler("aim", function(player) local vehicle = getPedOccupiedVehicle(player) if not vehicle then return outputChatBox("Use in vehicle...", player) end removePedFromVehicle(player) local object = createObject(2985, 0, 0, 0) setElementCollisionsEnabled(object, false) attachElements(object, vehicle, 0, -1.5, -0.25) attachElements(player, object, -0.4, 0, 0.8) triggerClientEvent(player, "aim", resourceRoot, vehicle, object) end) -- CLIENT local current addEvent("aim", true) addEventHandler("aim", resourceRoot, function(vehicle, object) current = { vehicle=vehicle, object=object } addEventHandler("onClientRender", root, aim) end) function aim() local camRot = getPedCameraRotation(localPlayer) setElementAttachedOffsets(current.object, 0, -1.5, -0.25, 0, 0, -camRot+90) end
  19. Was playing couple of months, and everything was ok. The last time I was playing ~3 days or something. And today I've got error: "[CD47]" o_O Have no clue for what i was banned, only cheats i have is for CSGO. I hope this issue will be resolved. Serial: C5C4942F85517EEDA0F6AF7FB81562B2 Thanks.
  20. Vou deixar! Só ta acontecendo uma coisa agora, dps de um dia de teste, é que por algum motivo, algumas vezes o script buga inteiro, e os player não morrem, mas estou tentando resolver, de qualquer forma agradecido estou ❤️
  21. Dutchman101

    "Unfair" Ban

    Same story as https://forum.mtasa.com/topic/124146-ddos-ban/ You too were an admin there, leaking player IP addresses so they could be DDoS'ed. This ban cannot be appealed
  22. Hello Community, i'm working on a tactical vehicle script , Basiclly i'm attaching a (machine gun) to the back of the (bobcat) vehicle, so that the player can hop in and used to be honest, i'm not sure that i have the entire idea on how to code it because ( i don't know how to make an aiming system ) i want to draw a crosshair on the screen and i want the player to be able to rotate the weapon. so my question is how can i make an ( aiming system ) for this.
  23. Hola como estan!! Te soy direct@ te vi por ahi y dije ustedes son los indicados, nunca me equivoque por ahora jeje y queria preguntarles si les interesa unirse a este hermoso server. Porqué me diran ustedes? Facil.... Tiene.. -Lideres de Facciones Abierto -Buena jugabilidad y gente piola - Staffs Serios -Premios Por Invitar Gente!! - Mucho mas les interesa??? VAMOS! discord: https://discord.gg/v8V9Ake https://www.youtube.com/watch?v=CaUO1bpweIM
  24. Gente me ajuda desde ontemdeontem eu entrei no meu mta baixei um servidor fui fazer o login , quando eu digitava a letra apaga imediatamente por favor me ajuda
  25. Yesterday
  26. Yo! Will you going to adapt this to single-player? I have really liked your hud.
  27. please refer the mta discord server script-help channel so we can have a more smooth conversation
  1. Load more activity