Jump to content
  • 0

Question

Posted

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

  • 0
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...