Advertisement
Emistry

[RO] Guild Leader Broadcast Command 1.3

Dec 20th, 2016
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. - script sample#guildmsg -1,{
  2.  
  3. OnInit:
  4. bindatcmd("b", strnpcinfo(3)+"::OnAtcommand");
  5. end;
  6.  
  7. OnAtcommand:
  8. .@gid = getcharid(2);
  9. if ( .@atcmd_numparameters <= 0 ) {
  10. dispbottom "You didnt enter any messages.";
  11. }
  12. else if ( !.@gid || getcharid(0) != getguildmasterid( .@gid ) ) {
  13. dispbottom "You aren't guild leader.";
  14. }
  15. else {
  16. .@message$ = implode( .@atcmd_parameters$, " " );
  17. query_sql( "SELECT `account_id` FROM `guild_member` WHERE `guild_id` = "+.@gid+" AND `online` = 1 LIMIT 100",.@aid );
  18. .@aid_size = getarraysize( .@aid );
  19. dispbottom "Found "+.@aid_size+" guild member.";
  20.  
  21. if ( .@aid_size ) {
  22. while ( .@i < .@aid_size ) {
  23. if ( attachrid( .@aid[.@i] ) ) {
  24. announce "[Guild Broadcast] "+.@message$,bc_self;
  25. detachrid;
  26. }
  27. set .@i, .@i + 1;
  28. }
  29. }
  30. }
  31. end;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement