Wysłany: 2016-01-06, 09:08
amama12345
Wiek: 25 Na forum: 4422 dni Posty: 50
Nick w MP: AmaMa
Piwa : 3
Witam jak do tego kodu doda? Scoreboard?
Prosz? o pomoc
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)
Wysłany: 2016-01-06, 12:39
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
Tam masz wszystkie funkcje, kt?re musisz u?y? w po??czeniu z exportowaniem.
Tagi: game :: points :: scoreboard
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: