Raised This Month: $51 Target: $400
 12% 

Round End / Game Commencing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-27-2016 , 12:56   Round End / Game Commencing
Reply With Quote #1

Is there anyway to block this event without the use of orpheu?
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-27-2016 , 13:08   Re: Block Game Commencing
Reply With Quote #2

Such event is triggered from CHalfLifeMultiplay::CheckWinConditions, when there are spawnable players in both teams.
Unfortunately, this offsets are members of CGameRules, so you still need orpheu to alter them. Even if you could alter them without orpheu, you would still need to hook CheckWinConditions.

So, you have to use orpheu/okapi for this.

Below is the decompiled code by Arkshine for this event:

PHP Code:
if (!m_bFirstConnected && m_iNumSpawnableTerrorist != && m_iNumSpawnableCT != 0)
{
    
CBasePlayer *pPlayer NULL;

    if (!
IsCareer() || ((pPlayer = (CBasePlayer*)UTIL_PlayerByIndex(gpGlobals->maxClients)) != NULL && pPlayer->IsBot()))
    {
        
UTIL_LogPrintf("World triggered \"Game_Commencing\"\n");

        
m_bFreezePeriod FALSE;
        
m_bCompleteReset true;

        
EndRoundMessage("#Game_Commencing"Event_Round_Draw);
        
TerminateRound(IsCareer() ? 3WinStatus_Draw);

        
m_bFirstConnected   true;

        
// TODO: Implement me.
        // TheBots->OnEvent( EVENT_GAME_COMMENCE, NULL, NULL );
    
}

If you are afraid of signature files(but you should not), use okapi.
__________________

Last edited by HamletEagle; 06-27-2016 at 13:11.
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-27-2016 , 13:40   Re: Block Game Commencing
Reply With Quote #3

Since i only want to block it for the first 20 seconds after the map has changed, is it possible to avoid it by keeping the players unassigned ?
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-27-2016 , 14:58   Re: Block Game Commencing
Reply With Quote #4

Why you don't want to use orpheu/okapi? I really don't understand. It's like any module, just copy the dll and you get it working.

If that makes you feel better, hamsandwich does some things as orpheu, but only for virtual functions.
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-27-2016 , 15:54   Re: Block Game Commencing
Reply With Quote #5

Orpheu is a little complicated for me, same for okapi...I rather not go into things that are over my head

Plus Okapi has memory leaking issues i remember you mentioned about

But the main reason is that i am working on a big addon, so i expect errors/crashes etc
So before i get it stable it would be recommended to use things i am familiar with

So is it possible to avoid it by keeping players unassigned ? or i will be just losing my time ?
__________________

Last edited by Depresie; 06-27-2016 at 15:55.
Depresie is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-26-2016 , 10:49   Re: Block Game Commencing
Reply With Quote #6

Bumping, I am back on this, i need some one who can help me do the following and also understand them

Blocking Game Commencing
Blocking Game Commencing in general

Triggering Game Commencing
Triggering Game Commencing in certain situations

Triggering Round End ( Without killing players )

Triggering Round End when there are no more players in one team or when the timer ends

Note: The maps this is gonna be used on don't have any objectives

Also, what would be better to do such thing orpheu or okapi ?
__________________

Last edited by Depresie; 09-26-2016 at 10:56.
Depresie is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-26-2016 , 11:08   Re: Block Game Commencing
Reply With Quote #7

Blocking Game Commencing: Exolents code from: https://forums.alliedmods.net/showpo...03&postcount=7
PHP Code:
#include <amxmodx> 

public plugin_init()  

    
register_message(get_user_msgid("TextMsg"), "test"


public 
test(msg_idmsg_destid
{     
    static 
msg[32
    
get_msg_arg_string(2msg31
     
    if (
equal(msg,"#Game_Commencing"))
    { 
        
//client_print(id, print_center, "") 
        
return PLUGIN_HANDLED 
    

     
    return 
PLUGIN_CONTINUE 

Triggering Game Commencing: Game Commencing only gets triggered once the both teams have 1 player minimum. The thing i would do is try setting all players of one certain team to spectator and transfer them back to their original game, that's how Game Commencing would be triggered.

Triggering Round End: When timer ends, Round End gets triggered automaticly doesn't it?

You can check if there are any players left in one team, if not, set round timer to 0.1 and round end will get triggered after 0.1 seconds?
__________________

Last edited by Napoleon_be; 09-26-2016 at 11:12.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-26-2016 , 11:19   Re: Block Game Commencing
Reply With Quote #8

Nope, when the timer ends on a map with no objectives, the round will end when all the players from one team are killed, however this can be fixed by creating a fake hostage entity, but the thing that bothers is this

When the last player from a team disconnects, round end is not triggered... i need to trigger round end somehow when the last player from a team quits

Btw about that script for blocking game commencing, i think it only blocks the text, not the event
__________________

Last edited by Depresie; 09-26-2016 at 18:22.
Depresie is offline
Reply



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:33.


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