iFoReX Posted July 12, 2012 Share Posted July 12, 2012 he intentado pero nada me ha funcionado como podria hacerlo ? Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 Supongo que se refiere a un script que guarde los datos al morir. Link to comment
iFoReX Posted July 12, 2012 Author Share Posted July 12, 2012 Si, he intentado peroo no encuentro la manera de como hacerlo me ayudarian aunque sea con las funciones que debo utilizar c: ? Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 Depende de como quieras guardarlo, temporariamente o en alguna database. Tenes que usar el evento: onPlayerWasted Link to comment
iFoReX Posted July 12, 2012 Author Share Posted July 12, 2012 quiero guardarlo en accountsdata Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 onPlayerWasted getPlayerAccount setAccountData Link to comment
iFoReX Posted July 13, 2012 Author Share Posted July 13, 2012 exports.scoreboard:addScoreboardColumn('Dinero') exports.scoreboard:addScoreboardColumn('Muertes') function sDeaths(killer) if killer ~= source then local muertes = getElementData(source,'Muertes') setElementData(source,'Muertes',muertes+1) end end addEventHandler("onPlayerWasted",root,sDeaths) function sMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Dinero", getPlayerMoney ( player ) ) end end setTimer(sMoney,2000,0) addEventHandler("onPlayerQuit",root,function() local playeracc = getPlayerAccount(source) if playeracc and not isGuestAccount(playeracc) then local playerDeaths = getElementData(source,"Muertes") setAccountData(playerac,"deathsSave",playerDeaths) end end ) addEventHandler("onPlayerLogin",root,function(_, playeracc) if ( playeraccount ) then local playerDeaths = getAccountData ( playeraccount, "deathsSave" ) if ( playerDeaths ) then setElementData(source,"deathsSave",playerDeaths) end end end ) addEventHandler("onPlayerQuit",root,function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "moneySave", playermoney ) end end ) addEventHandler("onPlayerLogin",root,function(_, playeraccount ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "moneySave" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end ) ? porque esto no sirve ? Link to comment
Recommended Posts