viewing paste gm shop + log v1.1 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
// http://hercules.ws/board/topic/8602-gm-shop/
 
/*
CREATE TABLE IF NOT EXISTS `gm_shop_log` (
  `id` BIGINT(20) UNSIGNED NOT NULL DEFAULT AUTO_INCREMENT,
  `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` VARCHAR(24) NOT NULL DEFAULT '',
  `item` VARCHAR(50) NOT NULL DEFAULT '',
  `reason` VARCHAR(255) NOT NULL DEFAULT '',
  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyI
 
*/
 
// item list
-   shop    gm_shop_npc -1,607:1,608:2,
 
prontera,155,181,5  script  Sample#gmshop   757,{
    if ( getgroupid() < 60 ) end;
    callshop "gm_shop_npc",1;
    npcshopattach "gm_shop_npc",1;
    end;
    
    OnBuyItem:
        mes "Why you try to get "+@bought_quantity[0]+" x "+getitemname( @bought_nameid[0] )+"?";
        mes " ";
        mes "Enter a reason...";
        while( input( .@reason$,4,70 ) );
        query_sql( "INSERT INTO `gm_shop_log` ( `account_id`,`char_id`,`name`,`item`,`reason`,`time` ) VALUES ( "+getcharid(3)+","+getcharid(0)+",'"+strcharinfo(0)+"','"+@bought_quantity[0]+"x "+getitemname( @bought_nameid[0] )+"','"+.@reason$+"',NOW() ) " );
        getitem @bought_nameid[0],@bought_quantity[0];
        close;
}
Viewed 1236 times, submitted by Emistry.