roy_ppp Posted September 11, 2010 Share Posted September 11, 2010 Onplayer out save team player onplayer login set team player Anyone help me please. thank you so much. Link to comment
Castillo Posted September 11, 2010 Share Posted September 11, 2010 first this is not a requesting forum and second you should check out the wiki but anyway i've made it for you this time, i hope it works i didn't had time to test it. server.lua: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "team") if (accountData) then setPlayerTeam(source,accountData) end 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) function onLogout(prevAccount) 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("onPlayerLogout", getRootElement(), onLogout) meta.xml: <meta> <info author="Castillo" version="1.0.0" type="script" description="team saver when quit/logout" /> <script src="server.lua" type="server"/> </meta> Link to comment
dzek (varez) Posted September 11, 2010 Share Posted September 11, 2010 Solid, I'm wondering why are you so often giving full script instead of direct someone how to make/fix it.. I'm not saying if it's bad or not.. Just thinking.. Also, there was a lot of topics like this one. I think little searching can bring the answer. Link to comment
Castillo Posted September 11, 2010 Share Posted September 11, 2010 Solid, I'm wondering why are you so often giving full script instead of direct someone how to make/fix it.. I'm not saying if it's bad or not.. Just thinking..Also, there was a lot of topics like this one. I think little searching can bring the answer. I know about this, i was just too lazy to explain it etc so just made the script, next time i will not post whole code Link to comment
roy_ppp Posted September 11, 2010 Author Share Posted September 11, 2010 I'm sorry .. 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