LearningRO Posted December 18, 2018 Posted December 18, 2018 hi, all i want to make NPC to accept buy gold from player, but when transaction succesed it make log transaction ex: Player 100 gold to NPC and at insert to table ex:"LOG_ZENY" = Player A has sell 100 Gold and get 10M zeny its possible? Sorry for my bad explain, im not good in english Quote
0 n0tttt Posted January 10, 2019 Posted January 10, 2019 I don't understand very well. conf/log_athena.conf: // Track Zeny Changes // Filter settings // 0 - don't log; 1 - log any zeny changes; 2.....1000000 - minimal absolute logging zeny value log_zeny: 0 Is this what you want? This is how the table works: -- -- Table structure for table `zenylog` -- # ZenyLog types # (M)onsters # (T)rade # (V)ending Sell/Buy # (S)hop Sell/Buy # (N)PC Change amount # (A)dministrators # (E)Mail # (B)uying Store # Ban(K) Transactions CREATE TABLE IF NOT EXISTS `zenylog` ( `id` int(11) NOT NULL auto_increment, `time` datetime NOT NULL, `char_id` int(11) NOT NULL default '0', `src_id` int(11) NOT NULL default '0', `type` enum('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL default 'S', `amount` int(11) NOT NULL default '0', `map` varchar(11) NOT NULL default '', PRIMARY KEY (`id`), INDEX (`type`) ) ENGINE=MyISAM AUTO_INCREMENT=1; I don't know if you want a npc shop with OnSellItem or something, but in case you want that kind of shop and it doesn't work, you can use something like this: prontera,150,150,4 script Seller 100,{ callshop "shop_seller",2; end; OnSellItem: for(.@size = getarraysize(@sold_nameid);.@i < .@size;.@i++) { if(@sold_nameid[.@i] == 969) { .@amt = @sold_amount[.@i]; .@zeny = 100000*.@amt; Zeny += .@zeny; delitem 969,.@amt; //query_logsql "INSERT INTO `zenylog` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '"+getcharid(0)+"'", '"+getcharid(3)+"'", 'S', '"+escape_sql(strcharinfo(3))+"')"; end; } } end; OnInit: npcshopattach "shop_seller"; end; } - shop shop_seller -1,512:1 Hope it works... if you want to use another table, tell me, because as I said, I didn't understand very well. Quote
Question
LearningRO
hi, all i want to make NPC to accept buy gold from player, but when transaction succesed it make log transaction
ex: Player 100 gold to NPC and at insert to table ex:"LOG_ZENY" = Player A has sell 100 Gold and get 10M zeny
its possible?
Sorry for my bad explain, im not good in english
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.