Advertisement
Emistry

[RO] GM @Request AtCommand

Sep 11th, 2018
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. // https://rathena.org/board/topic/116861-atcommand-request-modification-for-improvement/
  2.  
  3. - script gm_request_main -1,{
  4.  
  5. OnInit:
  6. .min_group_id$ = "99,90,80,70";
  7.  
  8. .gm_id_size = query_sql("SELECT `account_id` FROM `login` WHERE `group_id` IN ("+escape_sql(.min_group_id$)+")", .gm_id);
  9. bindatcmd "request", strnpcinfo(3)+"::OnAtcommand";
  10. end;
  11.  
  12. OnAtcommand:
  13. if (.@atcmd_numparameters > 0) {
  14. for (.@i = 0; .@i < .@atcmd_numparameters; .@i++)
  15. .@message$ = .@message$ + .@atcmd_parameters$[.@i] + " ";
  16.  
  17. .@name$ = strcharinfo(0);
  18. .@origin = getcharid(3);
  19. for (.@i = 0; .@i < .gm_id_size; .@i++) {
  20. if (attachrid(.gm_id[.@i])) {
  21. announce "(Request "+.@name$+"): "+.@message$, bc_self, 0xFFFF00;
  22. .@count++;
  23. detachrid;
  24. }
  25. }
  26. attachrid .@origin;
  27. dispbottom "Request has been received by "+.@count+" GM.";
  28. }
  29. end;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement