Add stagger cmd

This commit is contained in:
Jackzie 2022-02-18 21:33:36 -06:00
parent aa4eab2a76
commit a267dfc0e8
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
3 changed files with 30 additions and 0 deletions

View file

@ -552,4 +552,33 @@ public Action Command_BotsAttack(int client, int args) {
ReplyToCommand(client, "syntax: sm_bots_attack <target player> [target-hp]");
}
return Plugin_Handled;
}
public Action Command_Stagger(int client, int args) {
if(args > 0) {
static char arg1[32];
GetCmdArg(1, arg1, sizeof(arg1));
int target_list[1], target_count;
static char target_name[MAX_TARGET_LENGTH];
bool tn_is_ml;
if ((target_count = ProcessTargetString(
arg1,
client,
target_list,
1,
COMMAND_FILTER_ALIVE | COMMAND_FILTER_NO_MULTI,
target_name,
sizeof(target_name),
tn_is_ml)) <= 0
) {
/* This function replies to the admin with a failure message */
ReplyToTargetError(client, target_count);
return Plugin_Handled;
}
L4D_StaggerPlayer(target_list[0], target_list[0], NULL_VECTOR);
} else {
ReplyToCommand(client, "syntax: sm_stagger <target player>");
}
return Plugin_Handled;
}