Emistry icon

[RO] HBC Announcer - Group ID based

Emistry | PRO | 06/24/17 05:24:10 PM UTC | 0 ⭐ | 553 👁️ | Never ⏰ | []
text |

1.36 KB

|

None

|

0 👍

/

0 👎

// I want @hbc commandI want @hbc command
// If groupid 1 use the command, for example @hbc <message>
// There will be announce [Helper] User Name: <message>
// Announce color 0xCC99FF
 -	script	hbc_command_main	-1,{
 	function	func_AddGroup	{
		.@group_id = getarg(0,0);
		if ( .@group_id >= 0 ) {
			setd( ".hbc_group_"+.@group_id+"$", getarg( 1,"" ) );
			setd( ".hbc_group_color_"+.@group_id+"$", getarg( 2,"0xCC99FF" ) );
		}
		return;
	}
 	OnInit:
		// func_AddGroup( <group_id>, "<prefix/title>", "<text_color>" );
		func_AddGroup( 1, "Helper Lv1", "0xCC99FF" );
		func_AddGroup( 2, "Helper Lv2", "0xCC99FF" );
		func_AddGroup( 3, "Helper Lv3", "0xCC99FF" );
		func_AddGroup( 4, "Helper Lv4", "0xCC99FF" );
		// func_AddGroup( 99, "Helper Lv99", "0xCC99FF" );
 		bindatcmd("hbc", strnpcinfo(3)+"::OnAtcommand");
		end;
 	OnAtcommand:
		.@group_id = getgroupid();
		.@prefix$ = getd( ".hbc_group_"+.@group_id+"$");
		if ( .@prefix$ != "" ) {
			if ( .@atcmd_numparameters <= 0 ) {
				dispbottom "Usage: " + .@atcmd_command$ + " <message>";
			}
			else {
				.@message$ = "[" + .@prefix$ + "] " + strcharinfo(0) + ":";
				while ( .@i < .@atcmd_numparameters ) {
					.@message$ = .@message$ + " " + .@atcmd_parameters$[.@i];
					.@i++;
				}
				announce .@message$, bc_all, getd( ".hbc_group_color_"+.@group_id+"$");
			}
		}
		end;
}

Comments

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

    0 B

    |

    👍

    /

    👎