Try this out
Credits to Capuche. This is just a slightly modified version of their script.
prontera,155,170,5 script add storage 139,{
OnFri1200:
// online
do {
set .@size, query_sql( "SELECT `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ ( .@loop *128 ) +", 128", .@account_id );
for( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) {
getitem 512, 1, .@account_id[.@i];//Set item ID,Quantity
message rid2name( .@account_id[.@i] ), "^00CCFFYou've received an Apple.^000000";
}
set .@loop, .@loop +1;
}
while( .@size );
// offline
query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select '0', '#item_inventory_gift', '"+ .@item_id +"', '2', `char`.`account_id` "+
"from `char` where `char`.`online` = '0' on duplicate key update `global_reg_value`.`value` = '"+ .@item_id +"'";
close;
end;
OnPCLoginEvent:
if( #item_inventory_gift ) {
getitem #item_inventory_gift, 1;
message strcharinfo(0), "^00CCFFYou've received an Apple.^000000";
set #item_inventory_gift, 0;
}
end;
}
Hope this helps,
~Azura Skyy