Jump to content

Search the Community

Showing results for tags 'setaccountdata'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 4 results

  1. function comprarbandito ( thePlayer, command) local playeraccount = getPlayerAccount ( source ) takePlayerMoney ( thePlayer, 500000 ) setAccountData ( playeraccount, "rc.bandito", adquirido ) end addCommandHandler ( "comprarbandito", comprarbandito ) function Banditoadquirido (_, playeraccount ) if ( playeraccount ) then local ban = getAccountData ( playeraccount, "rc.bandito" ) if ( ban ) then Banditocomprado = true end end end addEvent ( "banditobuyed", true ) addEventHandler ( "banditobuyed", getRootElement(), Banditoadquirido ) This function takes 500000 dollars to give a player permission to use a RC Bandito in a gui (Like in GTA Online) but, when i put the command "comprarbandito" Bad argument @ getplayeraccount, got nil, i never used getplayeraccount or setplayeraccount, and i don't know if the other function (Banditoadquirido) will work
  2. Quando o usuário se desconectar eu quero que isto seja feito. addEventHandler('onPlayerQuit', root, function() local account = getPlayerAccount(source) setAccountData(account, 'vehitem', true) end) isso para quando o usuário logar novamente e fazer uma ação em específico essa verificação funcionar: local accsalvo = getPlayerAccount(source) if getAccountData(accsalvo, 'vehitem') then exports._infobox:addNotification(source, 'funcionou', 'warning') else exports._infobox:addNotification(source, 'não funcionou', 'warning') end só que ela sempre retorna false, como se o setAccountData fosse ignorado, e agora?
  3. This is the code: function onPlayerQuit ( thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local nametagszin = getPlayerNametagColor ( thePlayer ) setAccountData ( playeraccount, "ntszin", nametagszin ) end end end function onPlayerLogin (_, playeraccount ) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) then local nametagszin = getAccountData ( playeraccount, "ntszin" ) if ( nametagszin ) then setPlayerNametagColor ( thePlayer, r, g, b ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) No error(s)/warning(s) in debugscript 3.. What wrong?
  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, "wangcars.data") if data then if account and not isGuestAccount(account) then if isElement(wangvehicle[source]) then local id = getElementData(wangvehicle[source], "wangcars.id") 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, "wangcars.data", data) destroyElement(wangvehicle[source]) wangvehicle[source] = nil end setAccountData(account, "wangcars.data", toJSON(getElementData(source, "wangcars.data"))) -- error there, but it still saves it setElementData(source, "wangcars.data", 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.
×
×
  • Create New...