MartinPanZycia, po 1 tabela musi by? zdefiniowana przed funkcja, do tego 2inne argumenty gracza. Da?em ci argument trigera jako osoba. W triggerze musisz doda? ostatni argument osoba.
nazwyRang = {
[1] = "Silver 1 ",
[2] = "Silver 2",
[3] = "Silver 3 ",
[4] = "Silver 4 ",
[5] = "Gold 1 ",
[6] = "Gold 2 ",
[7] = "Gold 3 ",
[8] = "Gold 4 ",
[9] = "Global Elit",
}
addEvent("przydzielRangeSlownie",true)
addEventHandler("przydzielRangeSlownie",root,function(osoba)
local pER = getElementData(osoba,"Reputacja")
if pER >= 1000 and pER < 1015 then
setElementData(osoba,"er:ranga",nazwyRang[1])
setElementData(osoba,"er:rangaid",1)
elseif pER > 1014 and pER < 1050 then
setElementData(osoba,"er:ranga",nazwyRang[2])
setElementData(osoba,"er:rangaid",2)
elseif pER > 1049 and pER < 1100 then
setElementData(osoba,"er:ranga",nazwyRang[3])
setElementData(osoba,"er:rangaid",3)
elseif pER > 1099 and pER < 1230 then
setElementData(osoba,"er:ranga",nazwyRang[4])
setElementData(osoba,"er:rangaid",4)
elseif pER > 1229 and pER < 1420 then
setElementData(osoba,"er:ranga",nazwyRang[5])
setElementData(osoba,"er:rangaid",5)
elseif pER > 1419 and pER < 1580 then
setElementData(osoba,"er:ranga",nazwyRang[6])
setElementData(osoba,"er:rangaid",6)
elseif pER > 1479 and pER < 1740 then
setElementData(osoba,"er:ranga",nazwyRang[7])
setElementData(osoba,"er:rangaid",7)
elseif pER > 1739 and pER < 1950 then
setElementData(osoba,"er:ranga",nazwyRang[8])
setElementData(osoba,"er:rangaid",8)
elseif pER > 1949 then
setElementData(osoba,"er:ranga",nazwyRang[9])
setElementData(osoba,"er:rangaid",9)
end
end)
addEvent("er:rangaid",true)
addEventHandler("er:rangaid",root,
function(osoba)
local konto=getPlayerAccount(osoba)
local ile=(getAccountData(konto,"er:rangaid") or 0)
setElementData(osoba,"er:rangaid",ile)
end)
na razie tyle , z stron? z servera.
Idzie mi troche gorzej , pytanie bo nie chcia?em nic jeszcze bardziej psu? ale nic nie robi? z scoreborad ? ?eby wy?wietla?o te nazwy zamiast liczb ?
[ Dodano: 2017-02-14, 15:28 ]
getElementData(localPlayer,"er:rangaid"
zrobi?em to aby np. er:ranga gdy >= 1000 , to mia?o nazw? 1 ( i rozumowo do linijki)
local obrazRangi = guiCreateStaticImage(0.3,0.05,0.4,0.2,"img/rangi/ranga"..getElementData(localPlayer,"er:rangaid")..".png",true)
b?dzie si? wy?wietla? dany obrazek z nazw? rangi + powinno pisac na scoreboard .
(ja nie ka?? ci to zrobi? , po prostu ukazuj? ci moje pomys?y aby? nie mia? w?tpilow?ci dlaczego tak zrobi?em)
Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
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