Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 17/02/20 in all areas

  1. What's your server/client version? This could be problem due of https://github.com/multitheftauto/mtasa-blue/commit/d2c53c73e327ade55862043af9bd53da64dd351a (r20391), but it should be fixed, there was 2 commits that should correct this - https://github.com/multitheftauto/mtasa-blue/commit/24a233f6e897771504a270940e05ccc4652bce53 (r20394), and https://github.com/multitheftauto/mtasa-blue/commit/a5508d8cead013a0b08e9c2cddb5914e46be1abd (r20398), so i suggest you to update your server/client to r20398 or even higher.
    2 points
  2. I created a complex first person movement script with weapons and custom animations. This is the first version of it.
    1 point
  3. I believe it is good practice to nil any variable that is no longer in use, just like using local variables where ever possible. Every penny counts and although one penny alone is nothing, eventually it builds up to greater amounts. But yes, as far as affecting performance, it's exactly as IIYAMA said here
    1 point
  4. Thank you! worked and the problem is fixed. I updated to version 20402 and everything is 100% now.
    1 point
  5. It's not fail. You can create vehicles on client side too, and then you can use it.
    1 point
  6. In most cases not. It does indeed reduce memory, but that only matters when the variable contains a lot of data. For example: A variable that contains a table reference with > 1000 items. Cleaning this data will not boost your performance directly, it will only allow your users to use less HDD memory when they do not have enough ram installed. Which will indirect result in improving the performance. People with 4 gb ram installed on a windows 10 computer, that is segment you are helping.
    1 point
  7. Well, when I encountered this problem, it was from client events triggering for everyone when I had thought it was triggered for only 1 player... There are some Client Events such as onClientVehicleEnter that will trigger for every player on the server rather than just the player who enters the vehicle. If this proves to be the issue, then you'll just need to check if the player is the local player onClientVehicleEnter(player,seat) if(player==localPlayer)then -- Checks if the player is the local player or not -- Whatever Code end end There was another issue I discovered that was also "doubling up on everything" which happen to be how I was triggering client side events: triggerClientEvent("SomeClientEvent",source) -- Because I ignored/skipped the first argument, this would cause the event to trigger for everyone triggerClientEvent(source,"SomeClientEvent",source) -- This fixed that issue for me, the event would only trigger for the "source" player But in either of these cases, if they were a third player online, everything would triple and so on and so forth... It doesn't sound like this will be your problem, but still worth looking into, just in case of anything
    1 point
  8. addEventHandler('onVehicleExplode', root, setTimer(function () destroyElement(source) end, 2000, 1) )
    1 point
  9. addEventHandler("onPlayerChangeNick", root, function(_, nick) if (removeHex(nick):len() == 0) then outputChatBox("Nick inválido!", source, 255, 0, 0) cancelEvent(true) end end ) addEventHandler("onPlayerConnect", root, function(nick) if (removeHex(nick):len() == 0) then cancelEvent(true, "Nick inválido!") end end ) function removeHex(str) while(str:find("#%x%x%x%x%x%x")) do str = str:gsub("#%x%x%x%x%x%x","") end return str end
    1 point
  10. local vehicles = {} local minutes = 10 -- Depois de N minutos, o veículo será destruído. function removeVehicle(vehicle) if isElement(vehicle) then destroyElement(vehicle) vehicles[vehicle] = nil end end function startTimer(vehicle) if not vehicles[vehicle] then vehicles[vehicle] = setTimer(removeVehicle, minutes * 60000, 1, vehicle) end end function stopTimer(vehicle) if vehicles[vehicle] and isTimer(vehicles[vehicle]) then killTimer(vehicles[vehicle]) vehicles[vehicle] = nil end end addEventHandler("onVehicleEnter", root, function(_, SEAT) if SEAT == 0 then stopTimer(source) end end ) addEventHandler("onVehicleExit", root, function(_, SEAT) if SEAT == 0 then startTimer(source) end end ) Você pode usar o meu código acima. Quando o jogador sai de algum veículo, começa uma contagem de 10 minutos (você pode alterar o tempo). Se ninguém entrar no veículo em 10 minutos, o carro será destruído.
    1 point
  11. loadstring loads Lua code from a string into a function than you can call (to execute the loaded code). Looking at the loadstring error message, it does not appear that you're putting code into that, but rather a string of text, not code. You have two options: Either change line 65 to memo = guiCreateMemo(241, 24, 450, 437, "Bem vindo/a ao RPG City Reallife. Use o menu á esquerda para navegar pela documentação do servidor.\n\nRegras do Servidor:\n\n"..rules, false, window) and remove line 28 through 34 (the safer option, since you remove the ability for arbitrary code execution in your script) Or the second option, is to change the rules.txt file to contain valid code which this script expects. It appears to expect a table named theRules with a string of rules under the key "English", so your rules.txt should be local theRules = { ["English"] = "Art 1° - Não praticar Power Gaming: Mínimo (10H) Máximo(24H ..." } and it should load correctly. However, this is less safe, since it can allow someone with access to editing rules.txt to insert malicious code into the file, which is then executed on through clients' Lua interpreters.
    1 point
×
×
  • Create New...