Xedo Posted August 19, 2010 Posted August 19, 2010 hi gyus. I try to save team to account but every time after reconnect i'm not in saved team o_O, can anyone help me please?
NotAvailable Posted August 19, 2010 Posted August 19, 2010 here is 1: https://community.multitheftauto.com/index.php?p= ... ils&id=612
Castillo Posted August 19, 2010 Posted August 19, 2010 here is 1: https://community.multitheftauto.com/index.php?p= ... ils&id=612 read again what he asked please, you are giving a resource that detects acl groups not save his team into his account. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
NotAvailable Posted August 19, 2010 Posted August 19, 2010 here is 1: https://community.multitheftauto.com/index.php?p= ... ils&id=612 read again what he asked please, you are giving a resource that detects acl groups not save his team into his account. Hey i searched 10 secnds for it thats very long man!
Castillo Posted August 19, 2010 Posted August 19, 2010 meta.xml: <meta> <script src="saveteam.lua" type="server" /> </meta> saveteam.lua: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local playerTeam = getAccountData (theCurrentAccount, "team") setPlayerTeam(source,playerTeam) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement,thePreviousAccount) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local team = getPlayerTeam(source) local teamName = getTeamName(team) setAccountData (account, "team", teamName) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) this should work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Xedo Posted August 19, 2010 Author Posted August 19, 2010 tnx, but it doesn't works too i made something like you yesterday function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (accountData) then local playerTeam = getAccountData (theCurrentAccount, "Team") spawnPlayer (source, playerteam) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "Team", getPlayerTeam (source)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
dzek (varez) Posted August 19, 2010 Posted August 19, 2010 fixed function from solidsnake script function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local playerTeam = getAccountData (theCurrentAccount, "team") local teamElement = getTeamFromName(playerTeam) if (teamElement) then setPlayerTeam(source,playerTeam) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) not tested too, should work Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
NotAvailable Posted August 19, 2010 Posted August 19, 2010 Maybe wrong sided Slient side. Server side
50p Posted August 19, 2010 Posted August 19, 2010 Can someone answer me: What's the point of using getPlayerAccount in onPlayerLogin event? People, think for a moment. Also, can you login to a guest account? I'm pretty sure the 2nd line is pointless. "it doesn't work" is as helpful to us as saying "Jump!" to a depressed person standing on a cliff. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
dzek (varez) Posted August 20, 2010 Posted August 20, 2010 i was thinking about it too, but when i saw the same in another topic i just left my will to ask.. Haha, last sentence is great Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now