viewing paste guild package log | Athena

Posted on the | Last edited on
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
/*
    // add this sql table
        
    CREATE TABLE IF NOT EXISTS `guild_package_log` (
        `id` int(11) unsigned NOT NULL,
        `guild_id` int(11) unsigned NOT NULL,
        `name` varchar(30) NOT NULL DEFAULT '',
        `account_id` int(11) unsigned NOT NULL,
        `time` datetime NOT NULL default '0000-00-00 00:00:00',
        PRIMARY KEY ( `id` )
    ) ENGINE=MyISAM;
 
*/
 
 
/*
    in your guild package script...
    BEFORE they claimed the guild package, add this line
*/
 
mes "Claim Guild Package";
query_sql( "SELECT `account_id`,`master`,`time` FROM `guild_package_log` WHERE `guild_id` = "+.@guild_id+" LIMIT 1",.@aid,.@master$,.@time$ );
if( !.@aid ){
    // get guild packet
    getitem 512,1;
    getitem 512,2;
    getitem 512,3;
    query_sql( "INSERT INTO `guild_package_log` VALUES ( "+gettimetick(0)+","+.@guild_id+",'"+escape_sql( strcharinfo(0) )+"',"+getcharid(3)+",NOW() )" );
}
else{
    mes "Already claimed by "+.@master$+" on "+.@time$;
}
Viewed 1202 times, submitted by Emistry.