// 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
0 B
|👍
/👎