Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-01-10, 20:05


ace2277







Wiek: 33
Na forum: 5067 dni
Posty: 5



Respekt: 50

Ostrzeżeń: 20%
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]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-01-11, 18:34


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Sprawdz czy zas?b masz nazwany scoreboard.
I nazwa kolumny w scoreboard powinna byc taka sama jak nazwa element data

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dziala :: scoreboard
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku