Jump to content

"Odświerzenie" skryptu


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...