roy_ppp Posted September 11, 2010 Posted September 11, 2010 Onplayer out save team player onplayer login set team player Anyone help me please. thank you so much.
Castillo Posted September 11, 2010 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> San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted September 11, 2010 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. 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)!
Castillo Posted September 11, 2010 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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