Search the Community

Showing results for tags 'getelementdata'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me





Found 4 results

  1. Ola Eu estou aqui com esse erro: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] Queria saber como eu arrumaria isso. Codigo: ----------------------------------Função começo trabalho---------------------------------- function trabalho (source, player) if isElementWithinMarker(source, MarkerTrab)then if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source, player) trabalho = true veh[source] = createVehicle(408, 2150.14453125, -1977.4909667969, 13.546875) warpPedIntoVehicle (source, veh[source]) setElementData( source, "Emprego", "Lixeiro" ) outputChatBox ( "#007ff7Você agora esta empregado", getRootElement(), 255, 0, 0, true ) setElementVisibleTo(MarkerTrab1, source, true) setElementVisibleTo(BlipTrab1, source, true) end end addEventHandler("onMarkerHit", MarkerTrab, trabalho) ------------------------------------------------------------------------------------------- ----------------------------------------1Mark---------------------------------------------- function congelar1( hitElement, mesmaDimensao, source ) if getElementType(hitElement) == "vehicle" and mesmaDimensao then -- O Elemento que atingir a marca deve ser veículo if getElementData(source, "Lixeiro" , "Emprego") then setElementFrozen( hitElement, true ) -- true: Congelado | false: Descongelado setTimer( function(veh) setElementFrozen( veh, false ) end, 10000, 1, hitElement ) outputChatBox ( "#0077ff====================", getRootElement(), 255, 0, 0, true ) outputChatBox ( "#00ff77Aguardando pegar o lixo", getRootElement(), 255, 0, 0, true ) outputChatBox ( "#0077ff====================", getRootElement(), 255, 0, 0, true ) destroyElement (MarkerTrab1) destroyElement (BlipTrab1) else outputChatBox ( "#0077ffVocê não é um lixeiro", getRootElement(), 255, 0, 0, true ) end end -- fechando a condição end -- fechando a função addEventHandler("onMarkerHit", MarkerTrab1, congelar1)
  2. Xwad

    can't store data

    My problem is that it's not storing the data in the local mg = {}. The debugscript says: bad argumentum @ 'setElememtData' expected element at argument 1, got table Thanks in advance! function mg_pos() createMG(-2861.9, 19.4, 15.83, 0, 0, 188) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), mg_pos) --MG 1 local mg = {} function createMG(posX,posY,posZ,rotX,rotY,rotZ) local weapon_base = createObject ( 1897, posX,posY,posZ,rotX,rotY,rotZ) local weapon = createObject ( 356, 0,0,0) attachElements ( weapon, weapon_base, -0.55, 0, 0.75, 0, 0, 0) setElementData ( mg, "weapon_base", weapon_base) setElementData ( mg, "weapon", weapon) end
  3. Hello guys, for some reason debugscript is saying this..Heres my script piece: setElementData(p, "acc:admin", 7) if not getElementData(p, "acc:admin") > 0 then return end Nothing else changes acc:admin. Edit: Found the solution: setElementData(p, "acc:admin", 7) if not (getElementData(p, "acc:admin") > 0) then return end But, i still don't understand, so can someone explain me whats the difference between those code blocks?
  4. Miika

    toJSON bug?

    Hello there, I've almost finished my vehicle shop / saving / control system but i got this error when i log out or reconnect: ERROR: wangcars/shop_server.lua:16: Couldn't convert userdata argument to JSON, only valid resources can be included for this function. I've tested and the result is table but toJSON says that it is userdata. It still saves it to accountdata in toJSON and i can unpack it with fromJSON. So is this mta bug or what? Saving function: addEventHandler("onPlayerLogout", root, function(account) local data = getElementData(source, "") if data then if account and not isGuestAccount(account) then if isElement(wangvehicle[source]) then local id = getElementData(wangvehicle[source], "") local x, y, z = getElementPosition(wangvehicle[source]) local rx, ry, rz = getElementRotation(wangvehicle[source]) data[id][6] = x..", "..y..", "..z..", "..rx..", "..ry..", "..rz data[id][8] = getElementHealth(wangvehicle[source]) setElementData(source, "", data) destroyElement(wangvehicle[source]) wangvehicle[source] = nil end setAccountData(account, "", toJSON(getElementData(source, ""))) -- error there, but it still saves it setElementData(source, "", false) triggerClientEvent(source, "wangcars.refreshgrid", source) end end end ) I have almost same function when player quit but no need to post it. I could just ignore this, but it's anoying because it always outputs error in debugscript when somebody disconnects and i'm trying to keep debug clean as possible.