Skip to content

Commit

Permalink
Add rg_restart_round native (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
fant1kua authored and s1lentq committed Aug 29, 2019
1 parent c184475 commit 6988e81
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,13 @@ native rg_get_iteminfo(const ent, ItemInfo:type, any:...);
*/
native bool:rg_hint_message(const index, const message[], Float:duration = 6.0, bool:bDisplayIfPlayerDead = false, bool:bOverride = false);

/*
* Instantly restart round.
*
* @noreturn
*/
native rg_restart_round();

/*
* Instantly check win conditions.
*
Expand Down
16 changes: 16 additions & 0 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,21 @@ cell AMX_NATIVE_CALL rg_hint_message(AMX *amx, cell *params)
return pPlayer->CSPlayer()->HintMessageEx(message, args[arg_duration], args[arg_displayIfPlayerDead], args[arg_override]) ? TRUE : FALSE;
}

/*
* Instantly restart round.
*
* @noreturn
*
* native rg_restart_round();
*/
cell AMX_NATIVE_CALL rg_restart_round(AMX *amx, cell *params)
{
CHECK_GAMERULES();

CSGameRules()->RestartRound();
return TRUE;
}

/*
* Instantly check win conditions.
*
Expand Down Expand Up @@ -2273,6 +2288,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =

{ "rg_hint_message", rg_hint_message },

{ "rg_restart_round", rg_restart_round },
{ "rg_check_win_conditions", rg_check_win_conditions },
{ "rg_initialize_player_counts", rg_initialize_player_counts },

Expand Down

0 comments on commit 6988e81

Please sign in to comment.