ace2277
Wiek: 33 Na forum: 5067 dni Posty: 5
Kod: exports.scoreboard:addScoreboardColumn('Killed Zombies')
addEvent("onKilledZombies",true)
addEventHandler("onKilledZombies",root,
function (killer)
addPlayerKilledZombies(killer)
end)
function addPlayerKilledZombies(killer)
local account = getPlayerAccount(killer)
if isGuestAccount(account) then return end
local killedZombies = getAccountData(account,"killed zombies")
if not killedZombies then setAccountData(account,"killed zombies",0) end
setAccountData(account,"killed zombies",tonumber(killedZombies)+1)
setElementData(killer,"killed zombies",tonumber(killedZombies)+1)
end
addEventHandler("onPlayerLogin",root,
function ()
local account = getPlayerAccount(source)
if isGuestAccount(account) then return end
local killedZombie = getAccountData(account,"killed zombies")
if killedZombie then
setElementData(source,"killed zombies",tostring(killedZombies))
else
setElementData(source,"killed zombies",0)
end
end)
exports.scoreboard:addScoreboardColumn('Kills Players')
addEvent("onKillsPlayers",true)
addEventHandler("onKillsPlayers",root,
function (killer)
addPlayerKillsPlayers(killer)
end)
function addPlayerKillsPlayers(killer)
local account = getPlayerAccount(killer)
if isGuestAccount(account) then return end
local killsPlayers = getAccountData(account,"kills players")
if not killsPlayers then setAccountData(account,"kills players",0) end
setAccountData(account,"kills players",tonumber(killsPlayers)+1)
setElementData(killer,"kills players",tonumber(killsPlayers)+1)
end
addEventHandler("onPlayerLogin",root,
function ()
local account = getPlayerAccount(source)
if isGuestAccount(account) then return end
local killsPlayers = getAccountData(account,"kills players")
if killsPlayers then
setElementData(source,"kills players",tostring(killsPlayers))
else
setElementData(source,"kills playerss",0)
end
end)
Pokazuje b??d: Ateempt to index global 'exports'
O co tu chodzi?[/code]