Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. I didn't see any errors. I think it doesn't create the table. Before the line where appears the error, put this and tell me what it says. outputChatBox(tostring(elementBackpack), source)
  2. Sasu

    index problem

    If I remember correctly, MTA doesnt let you to change to the same nick.
  3. Sasu

    index problem

    local Names = {} function onPlayerChangeNick(o,n) local pSerial = getPlayerSerial(source) if not Names[pSerial] then Names[pSerial] = {} end table.insert(Names[pSerial], {o, n}) for i , v in ipairs (Names[pSerial]) do outputChatBox(i..": Old: "..v[1].." -> New: "..v[2], source) end end addEventHandler('onPlayerChangeNick',root,onPlayerChangeNick)
  4. Sasu

    a question

    viewtopic.php?f=91&t=69698&hilit=+resolution&sid=095da6c03cb9616230bd10f5f990c357#p649395
  5. Sasu

    index problem

    Does "Smth" have a value? Or you just want to insert "Smth" as a text?
  6. Good, if you have some problem with the script, dont hesitate to post it.
  7. elseif (source) then if getPedWalkingStyle(source) ~= 138 then outputChatBox("on.", source) setPedWalkingStyle(source, 138) else outputChatBox("off." ,source) setPedWalkingStyle(source, 0) end
  8. I'm only a normal player but thanks anyway.
  9. Client Sided function bWep() if source == wPistol then outputChatBox("You purchased a Pistol for $250.", 255, 255, 0) takePlayerMoney(250) triggerServerEvent("bPistol", localPlayer) end end addEventHandler("onClientGUIClick", getRootElement(), bWep) Server Sided function bPistol ( ) giveWeapon ( source, 22, 1 ) end addEvent("bPistol", true) addEventHandler("bPistol", root, bPistol) And always remember:
  10. getPedWalkingStyle function will always return a value so I will set you walking style 0. Exactly, what are you trying to do?
  11. Just play with the function. Try the example that wiki provide.
  12. Sasu

    [HELP] Tables

    I think this is more efficient. local fruits = {} function addItem(item, count) if item and count then item = tostring(item) fruits[item] = (fruits[item] or 0) + tonumber(count) end end addItem("banana", 5) addItem("apple", 1) addItem("cherry", 4) addItem("banana", 2) addItem("apple",8 ) for i,v in pairs(fruits) do outputChatBox(tostring(i).." = "..tostring(v)) end Output: banana = 7 apple = 9 cherry = 4
  13. Sasu

    [HELP] Tables

    Why don't you use the name of the fruit as index? It would be easier.
  14. table.sort(luaTable, function(a,b) return ( tonumber( a["time"] ) or 0 ) < ( tonumber( b["time"] ) or 0 ) end )
  15. Un proceso que se repite hasta completar una determinada condición, o mejor llamado en el idioma español un "bucle".
  16. Haces un ida y vuelta al server. /mp -> triggerServerEvent -> triggerClientEvent -> addEventHandler -> "onClientRender"
  17. Sasu

    Shaders.

    Haces un ida y vuelta al server side.
  18. Ok, but MTA could be optimized to use client scripts on another core, sync on other core. And Let a entire code for GTA don't you think?
  19. I recently brought parts and assembled my gaming rig. I can run Battlefield 4 on ultra at stable 60 fps most of the times. However, I discovered that MTA only uses 1 Core and is just not feasible making the game run at slower Frames when cores are hitting ~95%, considering that we are on 2014 and most CPUs are multicore. Even Minecraft uses at least 2-3 cores, not sure of that but runs really good with SEUS Shaders arround 70 FPS on quite big servers Here is the proof: I own a FX-8350 overclocked at 4.8 GHz with 8 GB of RAM at 1600 MHz. Pics: Running with almost no mods, just some particles and effects, arround 20~ players near. http://i.imgur.com/M0JJPa5.jpg Running with some mods nothing really big for my system, arround 17~ players near. http://i.imgur.com/0TuPPrG.jpg I think MTA Devs should try to at least try to make MTA to use 2-3 cores by most. If this has been discused before I would like to know since I didn't found nothing that has to do with this.
  20. Nunca he escuchado de poner un link en esa función, pero igual creo que no puedes (que alguien me corrija si me equivoco). Deberias usar primero downloadFile en caso de que uses mta 1.4 y en caso de que no uses ese puedes descargar el resource "downloadFile".
×
×
  • Create New...