Skip to content

Commit

Permalink
add SendClientMessageToAllExcept
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-broman committed Aug 29, 2012
1 parent 0b082a9 commit 14f199a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions gamemodes/modules/PBP/Text/functions.inc
Expand Up @@ -287,6 +287,28 @@ stock this.ShowLanguageSelection(playerid) {
ShowPlayerDialog(playerid, this.DIALOG_LANGUAGE_SELECTION, DIALOG_STYLE_LIST, "Select language", langs[1], "OK", "Cancel");
}

stock SendClientMessageToAllExcept(playerid, color, message[], va_args<>) {
this.CheckStringArgument(2, playerid);

if (numargs() > 3) {
va_formatex(this.TextBuffer, _, message, va_start<3>);

foreach(new p : Player) {
if (p != playerid) {
SendClientMessage(p, color, this.TextBuffer);
}
}
} else {
foreach(new p : Player) {
if (p != playerid) {
SendClientMessage(p, color, message);
}
}
}

return 1;
}

// formatex specifier for translatable strings
FormatSpecifier<'@'>(output[], string[]) {
strunpack(output, this.@(string));
Expand Down
1 change: 1 addition & 0 deletions gamemodes/modules/PBP/Text/header.inc
Expand Up @@ -129,6 +129,7 @@ forward this.ResetActiveLanguage();
forward this.GetLanguageFromLanguageCode(this.LANGUAGE_CODE:code);
forward this.ShowsLanguageSelection();
forward this.ShowLanguageSelection(playerid);
forward SendClientMessageToAllExcept(playerid, color, message[], va_args<>);

// Hooks
forward this.SendClientMessageToAll(color, message[], va_args<>);
Expand Down

0 comments on commit 14f199a

Please sign in to comment.