Raised This Month: $ Target: $400
 0% 

Cvar Util problem, Game commencing


Post New Thread Reply   
 
Thread Tools Display Modes
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
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 08-07-2019 , 14:13   Re: Cvar Util problem, Game commencing
Reply With Quote #2

Code:
static OrpheuFunction:handleFunc; HandleHookCheckWinConditionsPre = OrpheuRegisterHook( handleFunc, "OnCheckWinConditions_Pre" , OrpheuHookPre );

Code:
new OrpheuFunction:handleFunc = OrpheuGetFunction( "CheckWinConditions", "CHalfLifeMultiplay" ); HandleHookCheckWinConditionsPre = OrpheuRegisterHook( handleFunc, "OnCheckWinConditions_Pre" , OrpheuHookPre );

Also, I suggest you post the signature for CheckWinConditions that you're using.
__________________









Last edited by CrazY.; 08-07-2019 at 14:18.
CrazY. is offline
orel56000
Member
Join Date: Apr 2015
Old 08-07-2019 , 15:14   Re: Cvar Util problem, Game commencing
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
Code:
static OrpheuFunction:handleFunc; HandleHookCheckWinConditionsPre = OrpheuRegisterHook( handleFunc, "OnCheckWinConditions_Pre" , OrpheuHookPre );

Code:
new OrpheuFunction:handleFunc = OrpheuGetFunction( "CheckWinConditions", "CHalfLifeMultiplay" ); HandleHookCheckWinConditionsPre = OrpheuRegisterHook( handleFunc, "OnCheckWinConditions_Pre" , OrpheuHookPre );

Also, I suggest you post the signature for CheckWinConditions that you're using.
I don't have CheckWinConditions file, but that because I took this line from the infinity round plugin, which don't have it as well(I couldn't find any file named CheckWinConditions in his .zip file) maybe I'm wrong, and I just need to search and add it

Edit: I just added the signature CheckWinConditions and its still not working:
Code:
{
    "name"    : "CheckWinConditions",
    "class"   : "CGameRules",
    "library" : "mod",
    "indexes" : 
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : 65
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : 65
        }
    ]
}

Last edited by orel56000; 08-07-2019 at 15:19.
orel56000 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-07-2019 , 17:48   Re: Cvar Util problem, Game commencing
Reply With Quote #4

You can find all signatures you need in my jailbreak mod addons or if you search.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
orel56000
Member
Join Date: Apr 2015
Old 08-07-2019 , 17:54   Re: Cvar Util problem, Game commencing
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
You can find all signatures you need in my jailbreak mod addons or if you search.
there's an anti commencing in there? because i'm not sure if the signature is my problem
orel56000 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 08-07-2019 , 19:16   Re: Cvar Util problem, Game commencing
Reply With Quote #6

Delete the one you've now and put this in amxmodx/configs/orpheu/functions/CHalfLifeMultiplay, check if that solve your problem.
Code:
{ 
    "name"      : "CheckWinConditions", 
    "class"     : "CHalfLifeMultiplay", 
    "library"   : "mod", 
    "identifiers" : 
    [ 
        { 
            "os"    : "windows", 
            "mod"   : "cstrike", 
            "value" : [0x83,"*","*",0x53,0x55,0x8B,"*",0x56,0x33,"*",0x57,0x8A,"*","*","*","*"]
        },  
        {  
            "os"    : "linux",  
            "mod"   : "cstrike",  
            "value" : "_ZN18CHalfLifeMultiplay18CheckWinConditionsEv"  
        } 
    ] 
}
__________________









Last edited by CrazY.; 08-07-2019 at 19:20.
CrazY. is offline
orel56000
Member
Join Date: Apr 2015
Old 08-08-2019 , 00:00   Re: Cvar Util problem, Game commencing
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
Delete the one you've now and put this in amxmodx/configs/orpheu/functions/CHalfLifeMultiplay, check if that solve your problem.
Code:
{ 
    "name"      : "CheckWinConditions", 
    "class"     : "CHalfLifeMultiplay", 
    "library"   : "mod", 
    "identifiers" : 
    [ 
        { 
            "os"    : "windows", 
            "mod"   : "cstrike", 
            "value" : [0x83,"*","*",0x53,0x55,0x8B,"*",0x56,0x33,"*",0x57,0x8A,"*","*","*","*"]
        },  
        {  
            "os"    : "linux",  
            "mod"   : "cstrike",  
            "value" : "_ZN18CHalfLifeMultiplay18CheckWinConditionsEv"  
        } 
    ] 
}
if you read my code, you can see I added two checks, one says public when the public called and one says game comm when it detect game commencing, it shows the public message but dosen't show the game comm message, which means its successfully hooked the public but couldn't detect if its a game commencing.
orel56000 is offline
Reply


Thread Tools
Display Modes

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