Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Erlkonig

  1. Hello! https://forum.mtasa.com/forum/98-german-deutsch/
  2. Becaue the author of this topic is russian and translating this topic into russian let me answer in russian. Ask me if anybody need the translate. Дайте пожалуйста код в более нормальном виде, а не тексте. Опишите что вы хотите чтобы скрипт делал и когда именно возникает ошибка.
  3. Пришлите пожалуйста весь код. I guess it should be moved into russian section.
  4. https://forum.mtasa.com/forum/97-portuguese-português/ I am not sure that I'd translated it correctly but if you want to change the voice key then you can change it in the client setting, "voiceptt". I guess that still nobody can change it for the whole server.
  5. Try this. function bp() gnrl = getElementData(source,"Money") or 0 -- if gnrl is new and uses only here use local gnrl = ... if getElementData(source,"opexp") == "2500" then local new_money = tonumber(gnrl) + 1000 -- you should be sure that "Money" is number. setElementData(source, "Money", tostring(new_money)) outputChatBox("u got it", source, 255, 0, 0) end end I am not sure that is will help you because I am sure that on the new lua versions you can use "string" + number. Also, you can try to debug it. addCommandHandler("debugmoney", function(thePlayer) local money_data = getElementData(thePlayer, "Money" -- only in the case where the player is element with "money" if money_data then outputChatBox("Element Data of Money is "..money_data..".", thePlayer, 255, 255, 255) end end)
  6. I have no idea how can I do this, had tried something but nothing happens. I want to send the file via fetchRemote using multipart/form-data. Have someone experience in this stuff?
  7. Okay, after the beer is over I had realized that I had not restarted an "admin" resource. This is my fault. Sorry for this topic. The problem is solved. Also I am sorry because it was a very stupid mistake. I lost about 2 hours on this.
  8. I tried to export function "aSetPlayerMuted" but got the debug "failed to call 'admin:aSetPlayerMuted' [string "?"], I don't give an anything what's wrong. Maybe I still did not realize how to use call function. I hope that someone will help cause I did not did anything since 2 litres a beer. Thanks everyone who will send something under. Code of the script: if str[1] == "/mute" then if str[2] and str[3] then if tonumber(str[3]) then local seconds = str[3] * 60 local thisPlayer = getPlayerFromName(str[2]) if thisPlayer then exports["admin"]:aSetPlayerMuted(thisPlayer, not isPlayerMuted (thisPlayer), seconds) I am sorry for the screen but this is the code from of the meta.xml I do not plan to sleep until I will fix it. The function of the admin-resource: function aSetPlayerMuted ( player, state, length ) if ( setPlayerMuted ( player, state ) ) then if not state then aRemoveUnmuteTimer( player ) elseif state and length and length > 0 then aAddUnmuteTimer( player, length ) end return true end return false end I'll be sorry if this is a very stupid mistake...
  9. Erlkonig

    [HELP] block

    Do you want block the health of the vehicle on 400 if the source of damage is minigun or just block any damages for vehicle from minigun? Use this https://wiki.multitheftauto.com/wiki/OnClientVehicleDamage
  10. Code: addEvent("Tic.addVeh", true) addEventHandler("Tic.addVeh", root, function(source, model) local query = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) if query and #query > 0 then if vehicleConces[source] then if isPedInVehicle(source) then local r1, g1, b1, r2, g2, b2, r3, g3, b3 = getVehicleColor(vehicleConces[source], true) local conceSQL = { vehLife = getElementHealth(vehicleConces[source]), vehColor = { r1, g1, b1, r2, g2, b2, r3, g3, b3, }, vehTunning = {}, vehUpgrade = {}, } removeElementData(vehicleConces[source], "Tic.vehicleBank") destroyElement(vehicleConces[source]) local vehFuel = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) setElementData(vehicleConces[source], "DNL:Combustivel", vehFuel) dxMsg(source, "Your vehicle was saved in the garage!", "success") dbExec(database, "UPDATE playersConce SET Estado = ?, Dados = ? WHERE Account = ? AND Model = ?", "Garage", toJSON(conceSQL), getAccountName(getPlayerAccount(source)), model) dbExec(database, "UPDATE playersConce SET Fuel = ? WHERE Account = ?", getElementData(source, "DNL:Combustivel"), getAccountName(getPlayerAccount(source))) else dxMsg(source, "Get inside the vehicle and try again.", "info") end else dxMsg(source, "Your not have a vehicle!", "info") end end end ) About the solve: As I understand, you had destroyed the element before setElementData ( destroyElement(vehicleConces[source] ). Also in dbExec you're trying to get ElementData from source, not from vehicleConces[source].
  11. Debug says it all. For more please send the client-side & server-side code.
  12. Thank you very much! Also thanks for the topic with tutorial. It works already. I have to learn it!
  13. Is the the syntax which I used is correctly? Just a moment, I'll send the picture. The same HTTP request with firefox:
  14. Hi! Thanks for reply! I tried but the table is empty while the string returns the information. The code below: function newResult(getupdates) if getupdates then outputConsole("Start of iteration") local jsonUpdates = fromJSON(getupdates) for i, v in ipairs(jsonUpdates) do outputConsole(i..": "..v) end outputConsole("End of iteration") outputConsole(getupdates) else outputDebugString("ERROR!", 3) end end fetchRemote(link, newResult)
  15. Hello everyone! Im trying to solve this problem already 3rd day but no results. I am calling HTTP request and it returns JSON. For example it works in browser (Firefox doing it better). When Im trying to call that request with a callRemote, I got returned the table but when I list that with a iteration it's clear as I understand. When I am doing that with fetchRemote, it returns the correct string but I need that the table ofc . I am sure that I am doing something wrong but I do not know what exactly I am doing wrong. Thanks for everyone who will reply.
  16. Рекомендую с помощью RESCPU отследить сначала сколько процентов потре:Oет ресурс.
  17. What did you write for this time?
  18. I tested this script, it works. Can you try to test it the default MTA server?
  19. Erlkonig

    help me

    As I understand you correctly? You want to fix the vehicle when the vehicle cloose to broke. You can use that in client-side and vehicles will never break. addEventHandler("onClientVehicleDamage", getRootElement(), function() cancelEvent() end)
  • Create New...