Quote:
Originally Posted by hjkwe654
Is have a way to block each round start money?
|
Quote:
Originally Posted by Arkshine
After reviewing the code, try do the following :
- Hook CHalfLifeMultiplay::RestartRound() as pre and post ;
- In the function RestartRound() as pre, Hook and register CBasePlayer::AddAccount() as pre ;
- In the function AddAccount(), supercede ;
- In the function RestartRound() as post, unregister the AddAccount() forward.
|
With ReAPI:
Code:
#include <amxmodx>
#include <reapi>
new HookChain:handleHookAddAccount;
public plugin_init()
{
register_plugin( "Block Round Start Money", "1.0.0", "Arkshine" );
RegisterHookChain( RG_CSGameRules_RestartRound, "OnRestartRound_Pre", false );
RegisterHookChain( RG_CSGameRules_RestartRound, "OnRestartRound_Post", true );
}
public OnRestartRound_Pre()
{
handleHookAddAccount = RegisterHookChain( RG_CBasePlayer_AddAccount, "OnAddAccount", false );
}
public OnAddAccount( const this, amount, RewardType:type, bool:bTrackChange )
{
return HC_SUPERCEDE;
}
public OnRestartRound_Post()
{
DisableHookChain( handleHookAddAccount );
}