- script sample#guildmsg -1,{ OnInit: bindatcmd("b", strnpcinfo(3)+"::OnAtcommand"); end; OnAtcommand: .@gid = getcharid(2); if ( .@atcmd_numparameters <= 0 ) { dispbottom "You didnt enter any messages."; } else if ( !.@gid || getcharid(0) != getguildmasterid( .@gid ) ) { dispbottom "You aren't guild leader."; } else { .@message$ = implode( .@atcmd_parameters$, " " ); query_sql( "SELECT `account_id` FROM `guild_member` WHERE `guild_id` = "+.@gid+" AND `online` = 1 LIMIT 100",.@aid ); .@aid_size = getarraysize( .@aid ); dispbottom "Found "+.@aid_size+" guild member."; if ( .@aid_size ) { while ( .@i < .@aid_size ) { if ( attachrid( .@aid[.@i] ) ) { announce "[Guild Broadcast] "+.@message$,bc_self; detachrid; } set .@i, .@i + 1; } } } end; }