yagokurt 84 Posted May 17, 2014 Share Posted May 17, 2014 How i can change it to get a gift after X hour online? And for me isnt working the "hide". I click on box get the gift and it still there i try too the LSHIFT + P but didnt work Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 17, 2014 Author Share Posted May 17, 2014 How i can change it to get a gift after X hour online? And for me isnt working the "hide". I click on box get the gift and it still there i try too the LSHIFT + P but didnt work Follow the instructions. I left some comment lines in quest. They should show you what to do if you want some edits. And about cient side... Be careful where did you add these functions. If you need some help add skype ID: *** 1 Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 17, 2014 Share Posted May 17, 2014 How i can change it to get a gift after X hour online? And for me isnt working the "hide". I click on box get the gift and it still there i try too the LSHIFT + P but didnt work Check this: -- © 2014 Zetsu - This system it's made by me for metin2Dev.org -- Thanks: -- THS Dev Team -- Invictus for some changes -- Do not change Copyrights or re-post on another stupid forums! quest thsgiftdev begin state start begin when logout begin pc.setqf("giftsystemuse", 0) end when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) if pc.getqf("giftsystemuse") ~= 0 then if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() end end if pc.getqf("giftsystemuse") == 0 then local hours = 2 pc.setqf("giftsystemuse", get_time()+60*60*hours) end end function giverandomitem() local random_nr = number(1,5) local hours = 2 chat("I: The box it's opening...") -- Opening if random_nr==1 then pc.give_item2(tonumber(mysql_query('SELECT box1 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box1[1])) elseif random_nr==2 then pc.give_item2(tonumber(mysql_query('SELECT box2 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box2[1])) elseif random_nr==3 then pc.give_item2(tonumber(mysql_query('SELECT box3 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box3[1])) elseif random_nr==4 then pc.give_item2(tonumber(mysql_query('SELECT box4 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box4[1])) elseif random_nr==5 then pc.give_item2(tonumber(mysql_query('SELECT box5 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box5[1])) end pc.setqf("giftsystemuse", get_time()+60*60*hours) cmdchat("giftsyshide") end when button or info begin if pc.getqf("giftsystemuse") ~= 0 then if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() -- yeah..function don't try to bind that condition with this.. else chat("W: You have no gift. Try after 12 hours...") -- Played end end if pc.getqf("giftsystemuse") == 0 then local hours = 2 pc.setqf("giftsystemuse", get_time()+60*60*hours) end end end end I have added new variable named hours and you can change the hour there. If I understand right you want the player to receive the gift after 1 hour online for example,so I made the quest when you're logging out the time is set to 0 and you can't open it. I didn't have much time to made it, so this may not work properly 3 Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 17, 2014 Author Share Posted May 17, 2014 you forgot: chat("W: You have no gift. Try after "..tostring(hours).." hours...") But problem with show/hide is from client.. he said that LSHIFT + P doesn't work.. so.. 1 Link to comment Share on other sites More sharing options...
yagokurt 84 Posted May 17, 2014 Share Posted May 17, 2014 Thanks Zetsu. Alrdy add you How i can change it to get a gift after X hour online? And for me isnt working the "hide". I click on box get the gift and it still there i try too the LSHIFT + P but didnt work Check this: -- © 2014 Zetsu - This system it's made by me for metin2Dev.org -- Thanks: -- THS Dev Team -- Invictus for some changes -- Do not change Copyrights or re-post on another stupid forums! quest thsgiftdev begin state start begin when logout begin pc.setqf("giftsystemuse", 0) end when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) if pc.getqf("giftsystemuse") ~= 0 then if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() end end if pc.getqf("giftsystemuse") == 0 then local hours = 2 pc.setqf("giftsystemuse", get_time()+60*60*hours) end end function giverandomitem() local random_nr = number(1,5) local hours = 2 chat("I: The box it's opening...") -- Opening if random_nr==1 then pc.give_item2(tonumber(mysql_query('SELECT box1 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box1[1])) elseif random_nr==2 then pc.give_item2(tonumber(mysql_query('SELECT box2 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box2[1])) elseif random_nr==3 then pc.give_item2(tonumber(mysql_query('SELECT box3 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box3[1])) elseif random_nr==4 then pc.give_item2(tonumber(mysql_query('SELECT box4 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box4[1])) elseif random_nr==5 then pc.give_item2(tonumber(mysql_query('SELECT box5 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box5[1])) end pc.setqf("giftsystemuse", get_time()+60*60*hours) cmdchat("giftsyshide") end when button or info begin if pc.getqf("giftsystemuse") ~= 0 then if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() -- yeah..function don't try to bind that condition with this.. else chat("W: You have no gift. Try after 12 hours...") -- Played end end if pc.getqf("giftsystemuse") == 0 then local hours = 2 pc.setqf("giftsystemuse", get_time()+60*60*hours) end end end end I have added new variable named hours and you can change the hour there. If I understand right you want the player to receive the gift after 1 hour online for example,so I made the quest when you're logging out the time is set to 0 and you can't open it. I didn't have much time to made it, so this may not work properly Thanks i will take a look how u did and add to the quest from kingtsunami. I'm using this quest rnow. quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local ids = number(1,5) local items = { -- number_id vnum count size [1] = {279,1,2}, [2] = {19,1,2}, [3] = {299,1,2}, [4] = {169,1,2}, [5] = {159,1,2}, } if pc.get_empty_inventory_count() >= items[ids][3] then pc.give_item2(items[ids][1],items[ids][2]) pc.setqf("giftsystemuse", get_time()+60*60*12) cmdchat("giftsyshide") else syschat("You don't have enough space.") end end when button or info begin if pc.get_level() >= 105 then if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else syschat("You can open the box every 12 hours,please be patient.") end else syschat("You will need to be level 105 to open the giftbox.") end end end end Link to comment Share on other sites More sharing options...
yagokurt 84 Posted May 19, 2014 Share Posted May 19, 2014 Denic, using this quest if i'm not wrong will restart when the person teleport too sure? Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 19, 2014 Share Posted May 19, 2014 When you logout the time will be set to 0 and you can't open the box Link to comment Share on other sites More sharing options...
Sober 37 Posted May 19, 2014 Share Posted May 19, 2014 Denic, using this quest if i'm not wrong will restart when the person teleport too sure? Yes that's true. Link to comment Share on other sites More sharing options...
yagokurt 84 Posted May 19, 2014 Share Posted May 19, 2014 When you logout the time will be set to 0 and you can't open the box Yes but to get the total time then the person will need stay in the map without teleport. And i want put something like 6 hours or 12 hours then is too much :S. Link to comment Share on other sites More sharing options...
Cilindro 14 Posted May 24, 2014 Share Posted May 24, 2014 (edited) i have this error and when i open ther note hide ther show every time https://metin2.download/picture/xZ8REsC2kOd9P5r2Av1NI6ZPWjq4CFnh/.png Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 24, 2014 Author Share Posted May 24, 2014 (edited) i have this error and when i open ther note hide ther show every time https://metin2.download/picture/xZ8REsC2kOd9P5r2Av1NI6ZPWjq4CFnh/.png You don't have a function added. Respect the tutorial and don't change anything Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Sober 37 Posted May 24, 2014 Share Posted May 24, 2014 http://youtu.be/GgT6M60hICc Tell me what do you think By the way thanks for the system 2 Link to comment Share on other sites More sharing options...
Cilindro 14 Posted May 24, 2014 Share Posted May 24, 2014 (edited) i have this error and when i open ther note hide ther show every time https://metin2.download/picture/xZ8REsC2kOd9P5r2Av1NI6ZPWjq4CFnh/.png You don't have a function added. Respect the tutorial and don't change anything what i put all things the same way ther i see here in topic Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 25, 2014 Author Share Posted May 25, 2014 @fcporto, contact me on skype http://youtu.be/GgT6M60hICc Tell me what do you think By the way thanks for the system Cool but i would make a slot machine by that and letplayer to play with tickets Link to comment Share on other sites More sharing options...
Sober 37 Posted May 25, 2014 Share Posted May 25, 2014 Yes that's a good idea i will see what i can do Link to comment Share on other sites More sharing options...
Former Staff flygun 304 Posted May 29, 2014 Former Staff Share Posted May 29, 2014 Virtual-box says every time I active the quest Calls undeclared function! : mysql_query abort (core dumped) Link to comment Share on other sites More sharing options...
Night 366 Posted May 29, 2014 Share Posted May 29, 2014 (edited) Hello everybody Today I will show my new system - I decided to release it...It's a very simple system and useful for PServers. What does it do? Well, it gives a random item to a player at every 12 hrs. He must enter the game and click on a gift to get the item. GM can set 5 items in DB and one of them will be gived to the players. You can change time for this system e.g.: Items ID are stored in a new table called "surprisebox". Server_side: FirstReq: If somebody wants to add new conditions to quest, first ask me in pm, then post here. Probably some people would think that it's my mistake...Thanks for understanding! You must run this query to install: CREATE TABLE `surprisebox` ( `id` int(5) NOT NULL AUTO_INCREMENT , `openorclose` int(5) NOT NULL , `box1` int(8) NULL DEFAULT NULL , `box2` int(8) NULL DEFAULT NULL , `box3` int(8) NULL DEFAULT NULL , `box4` int(8) NULL DEFAULT NULL , `box5` int(8) NULL DEFAULT NULL , `date` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `hour` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=47 CHECKSUM=0 ROW_FORMAT=DYNAMIC DELAY_KEY_WRITE=0 ; Then run this: INSERT INTO `surprisebox` (`openorclose`,`box1`,`box2`,`box3`,`box4`,`box5`,`date`,`hour`) VALUES (1, ITEM_ID_1, ITEM_ID_2, ITEM_ID_3, ITEM_ID_4, ITEM_ID_5, '<date>', '<hour>'); This is just an example. You must have one row with column openorclose=1 , in rests 0 (that if you have more saved). Now you have to install the quest. Also, i made this system possible to be edited by anybody, so you can modify the codes.. thsgiftdev.quest DO NOT rename the quest. You must install it with name: thsgiftdev.quest or it doesn't work. If you renamed it i'll not help you. Good luck! -- (c) 2014 Zetsu - This system it's made by me for metin2Dev.org -- Thanks: -- THS Dev Team -- Invictus for some changes -- Do not change Copyrights or re-post on another stupid forums! quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("I: The box it's opening...") -- Opening if random_nr==1 then pc.give_item2(tonumber(mysql_query('SELECT box1 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box1[1])) elseif random_nr==2 then pc.give_item2(tonumber(mysql_query('SELECT box2 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box2[1])) elseif random_nr==3 then pc.give_item2(tonumber(mysql_query('SELECT box3 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box3[1])) elseif random_nr==4 then pc.give_item2(tonumber(mysql_query('SELECT box4 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box4[1])) elseif random_nr==5 then pc.give_item2(tonumber(mysql_query('SELECT box5 from player.surprisebox WHERE openorclose=1 LIMIT 1;').box5[1])) end pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 HRS cmdchat("giftsyshide") end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() -- yeah..function don't try to bind that condition with this.. else chat("W: You have no gift. Try after 12 hours...") -- Played end end end end Edit: If you want to show the box when the event it's running add under cmdchat("zetsugfsys "..q.getcurrentquestindex()) if tonumber(mysql_query('SELECT openorclose from player.surprisebox WHERE id>0 LIMIT 1;').openorclose[1]) != 0 then cmdchat("giftsysshow") else cmdchat("giftsyshide") end Download full: https://mega.co.nz/#!iZQiUbqY!VEULcrJ6set30fFQkkCRlD71U3Dvy-TjULhcIICC1JM Client_side: Be careful! Forum replace a blank by Tab button with spaces! Be careful at syntax. Open game.py(root) and search: self.playerGauge = None Under this add: ## Z ############################################################################## self.GiftBox = ui.Button() 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") self.GiftBox.SetText("?") self.GiftBox.SetToolTipText("Open the box!") self.GiftBox.SetPosition(10, int(wndMgr.GetScreenHeight())-126) self.GiftBox.SetEvent(self.ZetsuGiftSystem__deff__) self.GiftBox.Show() ## Z ############################################################################## ================================================================================================= Search: def OnUpdate(self): Under this, add: ## Z ############################################################################## if app.IsPressed(app.DIK_P) and app.IsPressed(app.DIK_LSHIFT): if self.GiftBox.IsShow(): self.GiftBox.Hide() else: self.GiftBox.Show() ## Z ############################################################################## or added to this function. Picture: Now search def __ServerCommand_Build(self): serverCommandList={ And add: ## Begin LuckyBoxes system by Zetsu "zetsugfsys" : self.ZetsuGiftSystem__init__, "giftsysshow" : self.ZetsuGiftSystem__show__, "giftsyshide" : self.ZetsuGiftSystem__hide__, ## End LuckyBoxes Picture: Do NOT add: "giftsyspop" : self.ZetsuGiftSystem__prnt__, My mistake... Now, the last thing it's to add the function at the end: ## Begin LuckyBoxes system by Zetsu def ZetsuGiftSystem__init__(self, index): constInfo.GIFTSYS = index # if doesn't work replace with: constInfo.GIFTSYS = int(index) # But it's impossible... def ZetsuGiftSystem__deff__(self): import event event.QuestButtonClick(int(constInfo.GIFTSYS)) ## End LuckyBoxes # Warning!! Let the last row empty!! ## def ZetsuGiftSystem__show__(self): self.GiftBox.Show() def ZetsuGiftSystem__hide__(self): self.GiftBox.Hide() Picture: Warning! If you add this at the end of game.py, the last line must be empty! Now open constinfo.py and add at the beginning of the file: GIFTSYS = 1 #####New: GS-Tool##### Don't add this PHP Cpannel to your website. Use a free domain or localhost. Config CPannel from dbCOnf.php also replace $dbname = "zetsusystems"; With $dbname = "player"; Download the button: mega.co.nz - Add it in: (Etc.epk/eix)D:/ymir work/ui Download PHP-CPannel: mega.co.nz Kind regards, Zetsu I offer support, just ask me here or in PM! Soon I will add PHP_CPannel for beginners. I know this system it's very simple and contains some parts where i choose the hard way, but anyway.. i think this system keeps players online. Note: If you want to hide the Box press: LShift+P Sometimes it's annoying xD ... great release ^^ thanks Edited August 22, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 29, 2014 Author Share Posted May 29, 2014 Virtual-box says every time I active the quest Calls undeclared function! : mysql_query abort (core dumped) http://metin2dev.org/board/topic/1142-releasegift-system-feedtheplayers-d/?p=8780 Link to comment Share on other sites More sharing options...
Mr.Blue 3 Posted June 5, 2014 Share Posted June 5, 2014 0605 17:18:26398 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR 0605 17:18:28072 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010). Automatic conversion will be attempted. 0605 17:18:36121 :: Traceback (most recent call last): 0605 17:18:36122 :: File "networkModule.py", line 231, in SetGamePhase 0605 17:18:36122 :: File "system.py", line 130, in __pack_import 0605 17:18:36122 :: File " 0605 17:18:36122 :: <string> 0605 17:18:36122 :: ", line 0605 17:18:36122 :: 107 0605 17:18:36122 :: 0605 17:18:36122 :: 0605 17:18:36122 :: self.stream=stream 0605 17:18:36122 :: 0605 17:18:36122 :: ^ 0605 17:18:36128 :: SyntaxError 0605 17:18:36128 :: : 0605 17:18:36128 :: invalid syntax 0605 17:18:36128 :: hii man wow its rly make u lose ur mind but I have some proplem I hope u can fix it my syserr: Link to comment Share on other sites More sharing options...
Zetsu 78 Posted June 6, 2014 Author Share Posted June 6, 2014 0605 17:18:26398 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR 0605 17:18:28072 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010). Automatic conversion will be attempted. 0605 17:18:36121 :: Traceback (most recent call last): 0605 17:18:36122 :: File "networkModule.py", line 231, in SetGamePhase 0605 17:18:36122 :: File "system.py", line 130, in __pack_import 0605 17:18:36122 :: File " 0605 17:18:36122 :: <string> 0605 17:18:36122 :: ", line 0605 17:18:36122 :: 107 0605 17:18:36122 :: 0605 17:18:36122 :: 0605 17:18:36122 :: self.stream=stream 0605 17:18:36122 :: 0605 17:18:36122 :: ^ 0605 17:18:36128 :: SyntaxError 0605 17:18:36128 :: : 0605 17:18:36128 :: invalid syntax 0605 17:18:36128 :: hii man wow its rly make u lose ur mind but I have some proplem I hope u can fix it my syserr: I need your game.py in private. Link to comment Share on other sites More sharing options...
Zetsu 78 Posted June 13, 2014 Author Share Posted June 13, 2014 (edited) Update 13.june.2014 - Take it now! It's still hot. I decided to add Gift box item! About it: Vnum: 17609 Use from level: 10 Can be used for: infinite times (you decide that) Can: - Can't: be stored, traded, sold. Icon: New quest update: Go to first page and take from there! Edited August 15, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Zetsu 78 Posted June 13, 2014 Author Share Posted June 13, 2014 Up! ^ Link to comment Share on other sites More sharing options...
mhmdhjere 15 Posted June 13, 2014 Share Posted June 13, 2014 That's just perfect Thank you so much ! 1 Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted June 15, 2014 Premium Share Posted June 15, 2014 Thanks you so much dude ! You rock ! But link about button are dead. http://youtu.be/GgT6M60hICc Tell me what do you think By the way thanks for the system Nice ! Are you goin' te release ? Link to comment Share on other sites More sharing options...
Zetsu 78 Posted June 16, 2014 Author Share Posted June 16, 2014 Thanks you so much dude ! You rock ! But link about button are dead. I'll try to solve it. Thanks! // Use another icon 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now