View Single Post
WaLkMaN
Senior Member
Join Date: Oct 2010
Location: Varna, Bulgaria
Old 05-06-2023 , 06:01   Re: Module: Orpheu2.3a
Reply With Quote #1508

Quote:
Originally Posted by hjkwe654 View Post
Is have a way to block each round start money?
Quote:
Originally Posted by Arkshine View Post
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 ); }
Attached Files
File Type: sma Get Plugin or Get Source (block_roundstart_money_reapi.sma - 211 views - 681 Bytes)
__________________
WaLkMaN is offline