Cze??. Ostatnio pisz? sobie skrypt na levele, ale okaza?o si?, ?e na starcie ju? s? problemy. Chodzi mi o to, ?e jak jaki? gracz osi?gnie np. 300 SRP (bo 100 SRP to 1 lvl) by?o na tabie napisane, ?e ma ten 3 level. Ca?y czas na tabie pokazuje, ?e mam 1 level, a jak dam setElementData(localPlayer, "player:exp", 1000") to od razu znika nawet ten 1 level. Prosz? o szybk? pomoc, poniewa? mam ma?o czasu.
Witam ot?? mam kod na scorboarda. Chcia?bym by id sortowa?o si? pokolei 1,2,3,4,5,6,7,8,9,10... itd.
kod
[lua]--[[
Autor: Asperek
Zakaz u?ywania bez zgody autora!
Zakaz udost?pniania bez zgody autora!
]]
--[[
Wszelkie prawa odkupione przez STOPseba!
]]--
local screenW, screenH = guiGetScreenSize()
local dxfont0_CaviarDreams_Bold = dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf", 30)
local dxfont1_CaviarDreams_Bold = dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf", 16)
local dxfont2_CaviarDreams_Bold = dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf", 14)
local dxfont3_CaviarDreams_Bold = dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf", 11)
local px,sy = guiGetScreenSize()
local px,py = (screenW/1920),(screenH/1080)
local zoom = 1
local fh = 1920
if px < fh then
zoom = math.min(2,fh/px)
end
-- tego nie ruszaj
local k = 1
local n = 19
local score = false
local font = dxCreateFont("font.ttf", 13) or "default-bold"
local ping = {}
local logo = false -- wylaczanie/wlaczanie loga w scoreboardzie
function dxDrawShadowText(text,x,y,w,h,color,size,font,x1,x2)
end
addEventHandler("onClientRender", root, function()
score = getKeyState("tab")
local gracze = getElementsByType("player")
if score ~= true then return end
-- werjsa z logiem
if logo == true then
dxDrawRectangle(screenW * 0.3068, screenH * 0.0370, screen...
function scoreFunc.sort(op1, op2)
if isElement(op1) and isElement(op2) then
return getElementData(op1, "id") < getElementData(op2, "id")
end
end
local czcionka = dxCreateFont(":ogrpg-gui/font.ttf", 10)
if not czcionka then czcionka = "default-bold" end
local czcionka2 = dxCreateFont(":ogrpg-gui/font.ttf", 10)
if not czcionka2 then czcionka2 = "default-bold" end
function scoreFunc.render()
--dxDrawImage(screenW * 0.2533, screenH * 0.0859, screenW * 0.4934, screenH * 0.8294, ":nm-scoreboard/sb.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
local allPlayers = {}
--table.insert(allPlayers, localPlayer)
for k, v in ipairs(getElementsByType("player")) do
if v ~= localPlayer then
table.insert(allPlayers, v)
end
end
table.sort(allPlayers, scoreFunc.sort)
local _allPlayers = allPlayers
allPlayers = {}
table.insert(allPlayers, localPlayer)
for i = 1, #_allPlayers do
allPlayers[i + 1] = _allPlayers[i]
end
_allPlayers = nil
[quote]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w, h=(sx/1680), (sy/1050)
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
local tabulator = false
local czcionka = dxCreateFont("f.ttf", 13*w)
local czcionka2 = dxCreateFont("f.ttf", 18*w)
local k = 1
local n = 13
local m = 13
if not czcionka then
czcionka = "default"
end
local zakladki = {
id = "ID",
name = "Nazwa",
reputation = "RP",
organization = "Organizacja",
uid = "UID",
ping = "Ping",
faction = "Frakcja",
forum = "mta-storiesrpg.pl"
}
local ss = 1
local tabulator=false
local ping = {}
function sort(op1, op2)
if isElement(op1) and isElement(op2) then
return getElementData(op1, "id") < getElementData(op2, "id")
end
end
function gui()
local players = {}
for i,v in ipairs(getElementsByType("player")) do
table.insert(p...
Witam, mam pewien problem
staram si? wykona? co? takiego:
Po klikni?ciu TAB wyskakuje lista u?ytkownik?w lecz gracze kt?rzy maj? premium powinni mie? z?oty kolor i tak jest lecz wtedy te? wida? ich na mapie, a w?a?nie temu chce zapobiec.
Jak zrobi? aby gracz nie by? widzialny na mapie, a na TAB'ie jego nick by? z?oty?
Pr?bowa?em wszystkiego
Moje zastosowania: