MACIEKW89 Posted October 12, 2013 Share Posted October 12, 2013 Witam! Tworzę serwer zombie i mam mały problemik z pokazywaniem na TAB ilości zabitych zombie. Po relogu (nie reconnect) pokazuje poprawną ilość aż do zabicia następnego zombie. call ( getResourceFromName ( "ZombieScoreboard" ), "scoreboardAddColumn", "Zabitych Zombie" ) addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer,50) addPlayerZombieKill(killer) end) function addPlayerZombieKill(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zabitych Zombie") if not zombieKills then setAccountData(account,"Zabitych Zombie",0) end setAccountData(account,"Zabitych Zombie",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zabitych Zombie") if zombieKills then setElementData(source,"Zabitych Zombie",tostring(zombieKills)) else setElementData(source,"Zabitych Zombie",0) end end) Z góry dzięki za pomoc. Link to comment
dzek (varez) Posted October 12, 2013 Share Posted October 12, 2013 po zabiciu zombie tez dodaj setElementData 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