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

Wysłany: 2017-02-13, 18:28


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
ogolnie to przerobi?em skrypt na reputacjie , w sensie te punkty reputacji
co s? chcia?bym aby by?y wy?wietlane jako Nazwy a nie jako liczby .

addEvent("przydzielRangeSlownie",true)
addEventHandler("przydzielRangeSlownie",root,function()
    local pER getElementData(source,"Reputacja")
    if pER >= 1000 and pER 1015 then
        setElementData(localPlayer,"er:ranga",nazwyRang[1])
        setElementData(localPlayer,"er:rangaid",1)
    elseif pER 1014 and pER 1050 then
        setElementData(localPlayer,"er:ranga",nazwyRang[2])
        setElementData(localPlayer,"er:rangaid",2)
    elseif pER 1049 and pER 1100 then
        setElementData(localPlayer,"er:ranga",nazwyRang[3])
        setElementData(localPlayer,"er:rangaid",3)
    elseif pER 1099 and pER 1230 then
        setElementData(localPlayer,"er:ranga",nazwyRang[4])
        setElementData(localPlayer,"er:rangaid",4)
    elseif pER 1229 and pER 1420 then
        setElementData(localPlayer,"er:ranga",nazwyRang[5])
        setElementData(localPlayer,"er:rangaid",5)
    elseif pER 1419 and pER 1580 then
        setElementData(localPlayer,"er:ranga",nazwyRang[6])
        setElementData(localPlayer,"er:rangaid",6)
    elseif pER 1479 and pER 1740 then
        setElementData(localPlayer,"er:ranga",nazwyRang[7])
        setElementData(localPlayer,"er:rangaid",7)
    elseif pER 1739 and pER 1950 then
        setElementData(localPlayer,"er:ranga",nazwyRang[8])
        setElementData(localPlayer,"er:rangaid",8)
    elseif pER 1949 then
        setElementData(localPlayer,"er:ranga",nazwyRang[9])
        setElementData(localPlayer,"er:rangaid",9)
    end
end)

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",
}

er:ranga to mia? by? wy?wietlany obrazek i nie wiem czy dobrze zrobi?em jako element , a w sumie , no tak przeczuwa?em ,?eby to tak wsadzi? .
a potem chcialem to zdefiniowa? jako
        local obrazRangi guiCreateStaticImage(0.3,0.05,0.4,0.2,"img/rangi/ranga"..getElementData(localPlayer,"er:rangaid")..".png",true)


w ka?dym razie nie dzia?a , a db3 nie ma . Bo bym powiedzia? gdzie bym zrobi? b??d .

[ Dodano: 2017-02-13, 18:34 ]
ogolnie zeby was nie wprowadzac w b??d to strona clienta

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-13, 19:40


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

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)


Po 2 poka? strone serwera jak wykonujesz trigger.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
MartinPanZycia
Wysłany: 2017-02-14, 15:20


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%

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.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-14, 16:41


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Po co ta 'ranga' ?


local obrazRangi guiCreateStaticImage(0.3,0.05,0.4,0.2"img/rangi/"..getElementData(localPlayer"er:rangaid")..".png",true)


i plik z ranga w folderze img/rangi nazywasz 1, 2,3 etc

HazeMaFaze, Chodzi?o o fragment gdzie triggerujesz 'przydzielRangeSlownie'

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: rangi
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