Raised This Month: $ Target: $400
 0% 

Cvar Util problem, Game commencing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
orel56000
Member
Join Date: Apr 2015
Old 08-07-2019 , 12:11   Cvar Util problem, Game commencing
Reply With Quote #1

Hey, I'm typing to block Game Commencing, I tryed to install infinity round, but the Cvar Util module crash my server, even with its fix plugin, so I don't really know if this module is necessary to block it, so can someone help me block game commencing without the infinity round?

that was my sketch:

Code:
new g_pGameRules;
new OrpheuHook:HandleHookCheckWinConditionsPre;
enum GameRulesMembers
{
    m_iRoundWinStatus,
    m_bFirstConnected,
    m_bMapHasBombTarget,
    m_bBombDefused,
    m_bTargetBombed,
    m_iHostagesRescued,
    m_bMapHasRescueZone,
    m_iMapHasVIPSafetyZone,
    m_bMapHasEscapeZone,
    m_pVIP,
    m_iNumTerrorist,
    m_iNumSpawnableTerrorist,
    m_iNumCT,
    m_iNumSpawnableCT,
    m_iHaveEscaped,
    m_iNumEscapers,
    m_flRequiredEscapeRatio,
};
 new const GameRulesMI[ GameRulesMembers ][] =
{
    "m_iRoundWinStatus",
    "m_bFirstConnected",
    "m_bMapHasBombTarget",
    "m_bBombDefused",
    "m_bTargetBombed",
    "m_iHostagesRescued",
    "m_bMapHasRescueZone",
    "m_iMapHasVIPSafetyZone",
    "m_bMapHasEscapeZone",
    "m_pVIP",
    "m_iNumTerrorist",
    "m_iNumSpawnableTerrorist",
    "m_iNumCT",
    "m_iNumSpawnableCT",
    "m_iHaveEscaped",
    "m_iNumEscapers",
    "m_flRequiredEscapeRatio"
};

#define get_mp_pdata(%1)     ( OrpheuMemoryGetAtAddress( g_pGameRules, GameRulesMI[ %1 ] ) )

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	static OrpheuFunction:handleFunc;
	HandleHookCheckWinConditionsPre = OrpheuRegisterHook( handleFunc, "OnCheckWinConditions_Pre" , OrpheuHookPre );

}

public OrpheuHookReturn:OnCheckWinConditions_Pre( const handleGameRules )
{
	ColorChat(0, "public");
	if( isGameCommencing() )
	{
		ColorChat(0, "Game comm");
		return  OrpheuSupercede;
	}
	return OrpheuIgnored;
}


bool:isGameCommencing()
{
        return !get_mp_pdata( m_bFirstConnected ) && get_mp_pdata( m_iNumSpawnableTerrorist ) && get_mp_pdata( m_iNumSpawnableCT );
}
the OnCheckWinConditions_Pre just never called
orel56000 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode