/*
CREATE TABLE `ragnarok_logs`.`bst_market_log` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL DEFAULT '',
`message` VARCHAR(150) NOT NULL DEFAULT '',
`time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;
*/
- script bst_atcommand -1,{
OnInit:
bindatcmd "bst",strnpcinfo(0)+"::OnCommand";
end;
OnCommand:
if ( !getstrlen(.@atcmd_parameters$) ) {
message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";
end;
}
if ( @bst_delay + 1800 > gettimetick(2) ) {
message strcharinfo(0), "There is a 30 min delay of using this command again";
end;
}
@bst_delay = gettimetick(2);
.@message$ = implode( .@atcmd_parameters$," " );
announce "[Market] "+ strcharinfo(0) +" : "+ .@message$, bc_all, 0x9999FF;
query_logsql( "INSERT INTO `bst_market_log` ( `name`, `message` ) VALUES ( '"+escape_sql(strcharinfo(0))+"', '"+escape_sql( getstrlen(.@message$)>150?substr(.@message$,0,149):.@message$ )+"' );" );
end;
}