mirror of
https://github.com/rehlds/reapi.git
synced 2025-01-13 23:28:07 +03:00
Add new native rg_observer_find_next_player
This commit is contained in:
parent
472d279c5a
commit
583fac9fd9
@ -1185,6 +1185,18 @@ native rg_disappear(const player);
|
||||
*/
|
||||
native rg_set_observer_mode(const player, const mode);
|
||||
|
||||
/*
|
||||
* Call origin function CBasePlayer::Observer_FindNextPlayer()
|
||||
* @note Player must be a valid observer (m_afPhysicsFlags & PFLAG_OBSERVER).
|
||||
*
|
||||
* @param player Player index.
|
||||
* @param bReverse If bReverse is true, finding order will be reversed
|
||||
* @param name Player name to find.
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native rg_observer_find_next_player(const player, const bool:bReverse = false, const name[] = "");
|
||||
|
||||
/*
|
||||
* Emits a death notice (logs, DeathMsg event, win conditions check)
|
||||
*
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
virtual void SendItemStatus() = 0;
|
||||
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false) = 0;
|
||||
virtual void Observer_SetMode(int iMode) = 0;
|
||||
virtual void Observer_FindNextPlayer(bool bReverse, const char *name = nullptr) = 0;
|
||||
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot) = 0;
|
||||
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon) = 0;
|
||||
virtual void SwitchTeam() = 0;
|
||||
|
@ -3242,6 +3242,34 @@ cell AMX_NATIVE_CALL rg_set_observer_mode(AMX* amx, cell* params)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call origin function CBasePlayer::Observer_FindNextPlayer()
|
||||
* @note Player must be a valid observer (m_afPhysicsFlags & PFLAG_OBSERVER).
|
||||
*
|
||||
* @param player Player index.
|
||||
* @param bReverse If bReverse is true, finding order will be reversed
|
||||
* @param name Player name to find.
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
cell AMX_NATIVE_CALL rg_observer_find_next_player(AMX* amx, cell* params)
|
||||
{
|
||||
enum args_e { arg_count, arg_index, arg_bReverse, arg_name };
|
||||
|
||||
CHECK_ISPLAYER(arg_index)
|
||||
|
||||
CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]);
|
||||
CHECK_CONNECTED(pPlayer, arg_index);
|
||||
|
||||
char nameBuf[MAX_PLAYER_NAME_LENGTH];
|
||||
const char* name = getAmxString(amx, params[arg_name], nameBuf);
|
||||
if (strcmp(name, "") == 0)
|
||||
name = nullptr;
|
||||
|
||||
pPlayer->CSPlayer()->Observer_FindNextPlayer(params[arg_bReverse] != 0, name);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Emits a death notice (logs, DeathMsg event, win conditions check)
|
||||
*
|
||||
@ -3455,6 +3483,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
|
||||
{ "rg_switch_best_weapon", rg_switch_best_weapon },
|
||||
{ "rg_disappear", rg_disappear },
|
||||
{ "rg_set_observer_mode", rg_set_observer_mode },
|
||||
{ "rg_observer_find_next_player", rg_observer_find_next_player },
|
||||
{ "rg_death_notice", rg_death_notice },
|
||||
{ "rg_player_relationship", rg_player_relationship },
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user