Xedo Posted August 19, 2010 Share 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? Link to comment
NotAvailable Posted August 19, 2010 Share Posted August 19, 2010 here is 1: https://community.multitheftauto.com/index.php?p= ... ils&id=612 Link to comment
Castillo Posted August 19, 2010 Share 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. Link to comment
NotAvailable Posted August 19, 2010 Share 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! Link to comment
Castillo Posted August 19, 2010 Share 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. Link to comment
Xedo Posted August 19, 2010 Author Share 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) Link to comment
dzek (varez) Posted August 19, 2010 Share 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 Link to comment
NotAvailable Posted August 19, 2010 Share Posted August 19, 2010 Maybe wrong sided Slient side. Server side Link to comment
50p Posted August 19, 2010 Share 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. Link to comment
dzek (varez) Posted August 20, 2010 Share 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 Link to comment
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