2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 15:45:31 +03:00

Added native rg_select_default_team

This commit is contained in:
s1lentq 2016-06-15 20:19:50 +07:00
parent 3101f29ff7
commit d6c3a21dbb
3 changed files with 27 additions and 0 deletions

View File

@ -529,3 +529,11 @@ native rg_switch_team(const index);
*
*/
native rg_switch_weapon(const index, const weapon);
/*
* To priority autoselect join to team
*
* @return Returns the Team Name
*
*/
native TeamName:rg_select_default_team();

View File

@ -421,6 +421,7 @@ public:
// BOMB MAP FUNCTIONS
virtual BOOL IsThereABomber() = 0;
virtual BOOL IsThereABomb() = 0;
virtual TeamName SelectDefaultTeam() = 0;
virtual bool HasRoundTimeExpired() = 0;
virtual bool IsBombPlanted() = 0;

View File

@ -1359,6 +1359,23 @@ cell AMX_NATIVE_CALL rg_switch_weapon(AMX *amx, cell *params)
return (cell)pPlayer->CSPlayer()->SwitchWeapon(pWeapon);
}
/*
* To priority autoselect join to team
*
* @return Returns the Team Name
*
* native TeamName:rg_select_default_team();
*/
cell AMX_NATIVE_CALL rg_select_default_team(AMX *amx, cell *params)
{
if (g_pGameRules == nullptr) {
MF_LogError(amx, AMX_ERR_NATIVE, "%s: gamerules not initialized", __FUNCTION__);
return FALSE;
}
return CSGameRules()->SelectDefaultTeam();
}
AMX_NATIVE_INFO Misc_Natives_RG[] =
{
{ "rg_set_animation", rg_set_animation },
@ -1413,6 +1430,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
{ "rg_swap_all_players", rg_swap_all_players },
{ "rg_switch_team", rg_switch_team },
{ "rg_switch_weapon", rg_switch_weapon },
{ "rg_select_default_team", rg_select_default_team },
{ nullptr, nullptr }
};