Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: points
1. Game Points + Scoreboard
Witam jak do tego kodu doda? Scoreboard?
Prosz? o pomoc :D


Cytat:

--[[
Created by Jurandovsky for gtao.pl
]]--


function resetPoints()
for k, v in ipairs(getElementsByType("player")) do
local acc = getPlayerAccount(v)
local pkts = getAccountData(acc, "g_points")
if type(pkts) ~= "number" or type(pkts) == "number" and pkts < 1 then
setAccountData(acc, "g_points", 0)
end
end
end
addEventHandler("onResourceStart", getRootElement(), resetPoints)

function givePoints()
local account = getPlayerAccount(client)
if isGuestAccount(account) then return end
setAccountData(account, "g_points", getAccountData(account, "g_points") + 1)
outputChatBox("Posiadasz : "..getPlayerPoints(client).." game points", client)
-- mozemy dodac jakies bonusy dodatkowe za ilosc pkt
end
addEvent("giveGPoint", true)
addEventHandler("giveGPoint", resourceRoot, givePoints)


function getPlayerPoints(player)
local acc = getPlayerAccount(player)
if isGuestAccount(acc) then return end
pkt = getAccountData(acc, "g_points")
return pkt
end

addCommandHandler("showpkt", function(plr, cmd)
outputChatBox("Posiadasz : "..getPlayerPoints(plr).." game points", plr)
end)