Freya Jorgenson Posted July 27, 2013 Posted July 27, 2013 Hi All, May I ask for any tips on how to enable the @order command? Thank you. Quote
Emistry Posted July 28, 2013 Posted July 28, 2013 - script Sample -1,{ OnInit: bindatcmd "order",strnpcinfo(3)+"::OnAtCommand"; end; OnAtCommand: .@guild_id = getcharid(2); if( .@guild_id && getcharid(0) == getguildmasterid( .@guild_id ) ){ .@name$ = strcharinfo(0); .@message$ = implode( .@atcmd_parameters$," " ); .@size = query_sql( "SELECT `account_id`,`char_id` FROM `guild_member` WHERE `guild_id` = "+.@guild_id+" AND `online` = 1 ORDER BY `position` ASC",.@aid,.@cid ); while( .@i < .@size ){ if( isloggedin( .@aid[.@i],.@cid[.@i] ) ) if( attachrid( .@aid[.@i] ) ){ announce .@name$+": "+.@message$,bc_self; .@received++; } .@i++; } attachrid( .@aid[0] ); dispbottom "Message sent.."+.@received+" received"; } end; } @order <messages> Quote
1 Capuche Posted July 28, 2013 Posted July 28, 2013 There was a mistake in this version, I forgot to re-attach the aid of the leader in the loop (@variable is attached to the character, so @variable of the member attached was null) - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); .@myaid = getcharid(3); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self; attachrid .@myaid; } .@i++; } } 1 Quote
Jasc Posted July 27, 2013 Posted July 27, 2013 Probably a custom command a server used using bindatcmd Quote
Freya Jorgenson Posted July 27, 2013 Author Posted July 27, 2013 Honestly, the first time I have heard of the command. A player asked me if I can do it, I believe it's a custom command where a Guild Leader can broadcast to his guild members via the @order command, and the only people that can read the broadcasted message are the guild members. Thanks. Quote
Patskie Posted July 27, 2013 Posted July 27, 2013 This have been made by @Capuche recently : - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self; } .@i++; } } Quote
Freya Jorgenson Posted July 28, 2013 Author Posted July 28, 2013 I have to whisper someone? Sorry, how to use? is this the @order? Quote
Patskie Posted July 28, 2013 Posted July 28, 2013 I have to whisper someone? Sorry, how to use? is this the @order? whisper npc:guild_announce and write your message that you want to broadcast Quote
Freya Jorgenson Posted July 31, 2013 Author Posted July 31, 2013 thank you emistry, patskie and capuche for taking time on this one .. really appreciated. Quote
Question
Freya Jorgenson
Hi All,
May I ask for any tips on how to enable the @order command?
Thank you.
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.