Emistry icon

[RO] Guild Leader Broadcast Command 1.3

Emistry | PRO | 12/20/16 01:54:13 PM UTC | 0 ⭐ | 503 👁️ | Never ⏰ | []
text |

850 B

|

None

|

0 👍

/

0 👎

-	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;
 }

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎