Advertisement
Emistry

[RO] HBC Announcer - Group ID based

Jun 24th, 2017
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. // I want @hbc commandI want @hbc command
  2. // If groupid 1 use the command, for example @hbc <message>
  3. // There will be announce [Helper] User Name: <message>
  4. // Announce color 0xCC99FF
  5.  
  6. - script hbc_command_main -1,{
  7.  
  8. function func_AddGroup {
  9. .@group_id = getarg(0,0);
  10. if ( .@group_id >= 0 ) {
  11. setd( ".hbc_group_"+.@group_id+"$", getarg( 1,"" ) );
  12. setd( ".hbc_group_color_"+.@group_id+"$", getarg( 2,"0xCC99FF" ) );
  13. }
  14. return;
  15. }
  16.  
  17. OnInit:
  18. // func_AddGroup( <group_id>, "<prefix/title>", "<text_color>" );
  19. func_AddGroup( 1, "Helper Lv1", "0xCC99FF" );
  20. func_AddGroup( 2, "Helper Lv2", "0xCC99FF" );
  21. func_AddGroup( 3, "Helper Lv3", "0xCC99FF" );
  22. func_AddGroup( 4, "Helper Lv4", "0xCC99FF" );
  23. // func_AddGroup( 99, "Helper Lv99", "0xCC99FF" );
  24.  
  25. bindatcmd("hbc", strnpcinfo(3)+"::OnAtcommand");
  26. end;
  27.  
  28. OnAtcommand:
  29. .@group_id = getgroupid();
  30. .@prefix$ = getd( ".hbc_group_"+.@group_id+"$");
  31. if ( .@prefix$ != "" ) {
  32. if ( .@atcmd_numparameters <= 0 ) {
  33. dispbottom "Usage: " + .@atcmd_command$ + " <message>";
  34. }
  35. else {
  36. .@message$ = "[" + .@prefix$ + "] " + strcharinfo(0) + ":";
  37. while ( .@i < .@atcmd_numparameters ) {
  38. .@message$ = .@message$ + " " + .@atcmd_parameters$[.@i];
  39. .@i++;
  40. }
  41. announce .@message$, bc_all, getd( ".hbc_group_color_"+.@group_id+"$");
  42. }
  43. }
  44. end;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement