Serginix Posted August 17, 2011 Posted August 17, 2011 Holas, taba haciendo un resouce q guarde cosas como tu dinero la vida y esas mamadas, pero al intentar hacer q me guarde, expecificamente el Equipo, No me funciona, mas sin embargo el resto si, la extructura del setAccountData, seria : function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "equipo", getPlayerTeam ( source )) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) Ok, Todo bien, omiti las otras cosas, Al Logearse seria: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "equipo") if (accountData) then local equipo = getAccountData (theCurrentAccount, "equipo") setPlayerTeam (source, equipo) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) La vdd, ya mire la wiki https://wiki.multitheftauto.com/wiki/GetPlayerTeam) y no se odnde fallo =S... gracias por su tiempo... "Proyecto SX" Owner
Castillo Posted August 18, 2011 Posted August 18, 2011 Mira, lo que tenes que hacer es guardar el nombre del equipo, no el elemento. function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "equipo", getTeamName(getPlayerTeam ( source ))) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "equipo") if (accountData) then local equipo = getAccountData (theCurrentAccount, "equipo") setPlayerTeam (source, getTeamFromName(equipo)) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Serginix Posted August 18, 2011 Author Posted August 18, 2011 Intentare, gracias como siempre. "Proyecto SX" Owner
Recommended Posts