Emirates scrie: ↑12 Iun 2021, 16:21
Am bagat, si trebuie sa iau butoanele care vin aici separat de undeva? sau unde gasesc present.tga ca in client am bagat dar nu apare nimic deocamdata..
self.GiftBox.SetUpVisual("d:/ymir work/ui/present.tga")
self.GiftBox.SetOverVisual("d:/ymir work/ui/present.tga")
self.GiftBox.SetDownVisual("d:/ymir work/ui/present.tga")
eu ti-am dat un exemplu de implementare buton.
Ce e mai sus e system de gift pe buton.
Daca vrei tutorial complet:
pe langa ce ai facut mai sus mai adauga in constinfo.py:
in etc/ui
pui poza asta
https://we.tl/t-FL9KmtX4hJ
si bagi questul asta:
Cod: Selectaţi tot
quest thsgiftdev begin
state start begin
when login begin
cmdchat("zetsugfsys "..q.getcurrentquestindex())
if pc.getqf("giftsystemuse") > get_time() then
cmdchat("giftsyshide")
end
end
function giverandomitem()
local random_nr = number(1,5)
chat("I: The box it's opening...") -- Opening
random_items = { 45009, 28013, 30044, 27105, 30029,} -- Items list
pc.give_item2(tonumber(random_items[random_nr]))
pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 hours (60*minutes*hrs, 30 minutes example: 60*30, 10 minutes example: 60*10)
cmdchat("giftsyshide")
end
when button or info begin
if pc.getqf("giftsystemuse") <= get_time() then
thsgiftdev.giverandomitem()
else
chat("W: You have no gift. Try after 12 hours...") -- Played
end
end
end
end
Acum trebuie sa te joci cu coordonatele si sa muti unde vrei icon-ul si sa schimbi icon-ul cu altul daca vrei.
Cod: Selectaţi tot
self.GiftBox.SetPosition(10, int(wndMgr.GetScreenHeight())-126)
Daca nu vrei system de gift pe buton pui altceva
Exemplu quest teleport:
Cod: Selectaţi tot
quest NEWTP begin
state start begin
when login begin
cmdchat("zetsugfsys "..q.getcurrentquestindex())
end
when button or info begin
local x
local y
local t
local e = pc.get_empire()
say_title ( "Metin2-Online" )
say_title ( "Teleport:" )
say ( "Salut," )
say ( "Unde vrei sa te duci?" )
local main_set = select ("PvP MAP (MOMENTAN)","DESERTUL","GROTA (V3) INCEPUT","Urmatoarea Pagina")
if main_set == 1 then
pc.warp ( 972800 , 153600 )
elseif main_set == 2 then
pc.warp ( 344000 , 502500 )
elseif main_set == 3 then
pc.warp ( 0 , 1203200 )
elseif main_set == 4 then
local main_set2 =select ("MAP 1 ALBASTRI","MAP 2 ALBASTRI","MAP 1 GALBENI","MAP 2 GALBENI","MAP 1 ROSI","MAP 2 ROSI","Nu mai vreau, multumesc.")
if main_set2 == 1 then
pc.warp ( 959600 , 269700 )
elseif main_set2 == 2 then
pc.warp ( 863800 , 246000 )
elseif main_set2 == 3 then
pc.warp ( 63200 , 166700 )
elseif main_set2 == 4 then
pc.warp ( 145700 , 239800 )
elseif main_set2 == 5 then
pc.warp ( 473900 , 954600 )
elseif main_set2 == 6 then
pc.warp ( 352300 , 882700 )
elseif main_set2 == 7 then
return
end
end
end
end
end
poti pune orice quest, dar trebuie sa ai asta in el ca sa se actioneze de pe butonul pus mai sus
Cod: Selectaţi tot
when login begin
cmdchat("zetsugfsys "..q.getcurrentquestindex())
end