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

CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
PMA.Predator
Member
Join Date: Jan 2012
Old 06-02-2012 , 16:28   Re: CS:GO
Reply With Quote #11

Aha, a little more testing and:

Code:
Msg("S9.01\n");
    const char* basepath2 = ConVarRef("pma_basepath").GetString();
    Msg("S9.02\n");
    File.CheckDirectory("cfg/%s/", basepath2);
    Msg("S9.03\n");
produces the following result:
Code:
S9.01
ConVarRef pma_basepath doesn't point to an existing ConVar
S9.02
However my understanding is that this line:
ConVar_Register( 0 );
Is suppsed to register all my declared cvars, this is being called before that line so I'm not sure why thats not working, unless it's tied in to the ConnectTier things?
PMA.Predator is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 06-03-2012 , 00:25   Re: CS:GO
Reply With Quote #12

The ConnectTier1Libraries() crash is entirely my fault and should now be fixed. I've updated the interfaces.lib in our SDK.

As for your convar issue, my guess is that g_pCVar isn't being initialized. ConVar_Register will bail out and not do anything if it is null. In SourceMod we end up setting this ourselves. However, ConnectTier1Libraries() should also be setting this, so there's a good chance the updated lib will also fix this problem.

Last edited by DS; 06-03-2012 at 00:26.
DS is offline
PMA.Predator
Member
Join Date: Jan 2012
Old 06-03-2012 , 09:28   Re: CS:GO
Reply With Quote #13

Cheers for quick update! It's compiled and loading now.

So, after some nice few hours of testing there is a few things which I'm a bit confused about!

1. I've noticed the SayText (Not checked SayText2) seems to use different colours / codes now, is there a list of available colours or replacements for the dark green / light green?

2. ShowMenu is displaying in a very unique way, I mean, they're massive and taking up 1/3 of the screen. Not that this is a major problem, people with vision difficulties are now going to find it nice and easy to use my plugin but I'm just curious if this is supposed to happen? If it is, is there a way to make it look like the radio menus do now?

3. With VFuncs and Offsets, what's the best way to go around getting the new VFunc and offset values?
http://www.sourcemodplugins.org/pages/vtableoffsets/ Is not currently updated to include CS:GO, I currently use:
CBaseCombatCharacter::Weapon_GetSlot(int)cons t
CCSPlayer::GiveNamedItem(char const*,int)
CCSPlayer::RemoveAllItems(bool)

Also, does anyone have the offsets for clantag in CS:GO?

4. Game events, I've got it telling me that round_start, round_freeze_end and a few others do not exist anymore, I'm just downloading the dedicated server files (at 50kb/s ) in the hope that the res files are in there, does anyone have a list of these events and their parameters?

Thanks for the help!
- Edd
PMA.Predator is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-03-2012 , 10:50   Re: CS:GO
Reply With Quote #14

Quote:
Originally Posted by PMA.Predator View Post
1. I've noticed the SayText (Not checked SayText2) seems to use different colours / codes now, is there a list of available colours or replacements for the dark green / light green?
I don't know that anyone's made a concrete list yet. Easily way is to just try them.

Quote:
Originally Posted by PMA.Predator View Post
2. ShowMenu is displaying in a very unique way, I mean, they're massive and taking up 1/3 of the screen. Not that this is a major problem, people with vision difficulties are now going to find it nice and easy to use my plugin but I'm just curious if this is supposed to happen? If it is, is there a way to make it look like the radio menus do now?
We haven't had any display issues with radio menus from SM, using the same code for them we use in all other games. There are however a few quirks due to CS:GO client differences. menuselect 0 will never fire, and no menuselect will fire when dead/observing.

Quote:
Originally Posted by PMA.Predator View Post
3. With VFuncs and Offsets, what's the best way to go around getting the new VFunc and offset values?
http://www.sourcemodplugins.org/pages/vtableoffsets/ Is not currently updated to include CS:GO, I currently use:
CBaseCombatCharacter::Weapon_GetSlot(int)cons t
CCSPlayer::GiveNamedItem(char const*,int)
CCSPlayer::RemoveAllItems(bool)
There's a wiki article for finding them on your own, but since I have a list handy:
win lin
CBaseCombatCharacter::Weapon_GetSlot(int)cons t 283 284
CCSPlayer::GiveNamedItem(char const*,int) 435 436
CCSPlayer::RemoveAllItems(bool) 372 373


Quote:
Originally Posted by PMA.Predator View Post
Also, does anyone have the offsets for clantag in CS:GO?
CS:GO doesn't use clan tags (yet?)

Quote:
Originally Posted by PMA.Predator View Post
4. Game events, I've got it telling me that round_start, round_freeze_end and a few others do not exist anymore, I'm just downloading the dedicated server files (at 50kb/s ) in the hope that the res files are in there, does anyone have a list of these events and their parameters?
The modevents.res file will be nestled inside the vpk file set. I've attached the current one.
psychonic is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 06-03-2012 , 11:16   Re: CS:GO
Reply With Quote #15

Quote:
Originally Posted by PMA.Predator View Post
Cheers for quick update! It's compiled and loading now.

So, after some nice few hours of testing there is a few things which I'm a bit confused about!

1. I've noticed the SayText (Not checked SayText2) seems to use different colours / codes now, is there a list of available colours or replacements for the dark green / light green?

2. ShowMenu is displaying in a very unique way, I mean, they're massive and taking up 1/3 of the screen. Not that this is a major problem, people with vision difficulties are now going to find it nice and easy to use my plugin but I'm just curious if this is supposed to happen? If it is, is there a way to make it look like the radio menus do now?

3. With VFuncs and Offsets, what's the best way to go around getting the new VFunc and offset values?
http://www.sourcemodplugins.org/pages/vtableoffsets/ Is not currently updated to include CS:GO, I currently use:
CBaseCombatCharacter::Weapon_GetSlot(int)cons t
CCSPlayer::GiveNamedItem(char const*,int)
CCSPlayer::RemoveAllItems(bool)

Also, does anyone have the offsets for clantag in CS:GO?

4. Game events, I've got it telling me that round_start, round_freeze_end and a few others do not exist anymore, I'm just downloading the dedicated server files (at 50kb/s ) in the hope that the res files are in there, does anyone have a list of these events and their parameters?

Thanks for the help!
- Edd
as far as i remember there are colors upto \x08
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
PMA.Predator
Member
Join Date: Jan 2012
Old 06-03-2012 , 11:28   Re: CS:GO
Reply With Quote #16

Thanks for the fast response

1. I'm just going to write a quick test line to print with all the codes I know, \x01 - \x04 (I don't think there are any others?)

2. Here's what my ShowMenu is doing:
http://screenshot.xfire.com/s/123779912-4.jpg
It's rather, large? Here's the code to generate that:
Code:
void Utilities::CMessages::ShowMenu(char* cpPlayers, int iMenuOptions, const char* ccMessage, ...)
{
    MRecipientFilter rFilter;
    rFilter.AddByFilter(cpPlayers);
    if (!rFilter.GetRecipientCount()) return;
    MultiParms(ccMessage);
    bf_write *pBuffer;
    pBuffer = pEngine->UserMessageBegin((IRecipientFilter *) &rFilter, miShowMenu, "ShowMenu" );
    pBuffer->WriteShort( iMenuOptions ); 
    pBuffer->WriteChar( -1 ); 
    pBuffer->WriteByte( false );
    pBuffer->WriteString( scCompleteStr ); 
    pEngine->MessageEnd();
    rFilter.RemoveAll();
}

// Cut from MRecipientFilter.cpp
bool MRecipientFilter::AddByFilter(const char* csFilter) 
{ 
    m_Recipients.RemoveAll();
    // Add players by filter
    if (csFilter[0] == '#')
    {
        for (int i = 1; i <= gpGlobals->maxClients; i++) 
        { 
            edict_t* pEdict = pEngine->PEntityOfEntIndex(i); 
            if ( !pEdict || pEdict->IsFree() ) continue;
            IPlayerInfo *pPlayer = pPlayerManager->GetPlayerInfo(pEdict);
            if ( !pPlayer || !pPlayer->IsConnected() || !pPlayer->IsPlayer() ) continue;

            if (strcmp(csFilter,"#all") == 0 || strcmp(csFilter,"#a") == 0) 
                AddAll();
            else if (strcmp(csFilter,"#t") == 0)
                AddTeam(TERRORIST);
            else if (strcmp(csFilter,"#ct") == 0 || strcmp(csFilter,"#c") == 0)
                AddTeam(COUNTERTERRORIST);
            else if (strcmp(csFilter,"#spec") == 0 || strcmp(csFilter,"#s") == 0)
                AddTeam(SPECTATOR);
            else if (strcmp(csFilter,"#unas") == 0 || strcmp(csFilter,"#u") == 0)
                AddTeam(UNASSIGNED);
            else if (strcmp(csFilter,"#admin") == 0)
                AddAdmins();
            else
                return false;
        }
        return true;
    }
    int iUserID = atoi(csFilter);
    // Let's check if it's UserID, SteamID or Username/(Partial).
    for (int i = 1; i <= gpGlobals->maxClients; i++) 
    { 
        edict_t* pEdict = pEngine->PEntityOfEntIndex(i); 
        if ( !pEdict || pEdict->IsFree() ) continue;
        IPlayerInfo *pPlayer = pPlayerManager->GetPlayerInfo(pEdict);
        if ( !pPlayer || !pPlayer->IsConnected() || !pPlayer->IsPlayer() ) continue;

        if (pPlayer->GetUserID() == iUserID) {
            m_Recipients.AddToTail(i);
        } 
        else if (strcmp(pPlayer->GetNetworkIDString(), csFilter) == 0) {
            m_Recipients.AddToTail(i);
        }
        else if (strcmp(pPlayer->GetName(), csFilter) == 0) {
            m_Recipients.AddToTail(i);
        }
        else if (strstr(pPlayer->GetName(), csFilter) )  {
            m_Recipients.AddToTail(i);
        }
    }
    return true;
}
3. Thanks for the values =] About to go and test those. I'm hoping I can get them myself once my linux server is installed Shame about the clantags, I assume they'll add it in eventually

4. I reverted my code to using the IGameEventManager so that it would automatically pickup all events (So many player_footstep and player_hurts in the log file >.<) and it showed that round_start and the others which I hook are all still there and it fired them! Looking over the logs I'm getting some odd messages:
Code:
GameEventListener2 callback in list that should NOT be - round_start!
GameEventListener2 callback in list that should NOT be - round_freeze_end!
GameEventListener2 callback in list that should NOT be - round_end!

// When I added some more
GameEventListener2 callback in list that should NOT be - player_hurt!
GameEventListener2 callback in list that should NOT be - player_death!

// Code used to add events:
void CMatchAdmin::InitEvents(bool bNoisy)
{
    pEvent->RemoveListener( this );
    pEvent->AddListener( this, "player_changename", true);
    pEvent->AddListener( this, "round_start", true);
    pEvent->AddListener( this, "round_end", true);
    pEvent->AddListener( this, "round_freeze_end", true);
    pEvent->AddListener( this, "server_addban", true);
    pEvent->AddListener( this, "server_removeban", true);

    if (bNoisy)
    {
        pEvent->AddListener( this, "player_death", true);
        pEvent->AddListener( this, "player_hurt", true);
        Message.Log("CMatchAdmin::NoisyEvents");
    }
}
Has something changed with how I should add events to the listener?



Here's some more interesting things I've noticed also:

When the plugin first loads at game start, this is prouced:
Code:
**************************************************************************************************
PMA ~ Loading (Version 5.0A, http://Preds-Match-Admin.co.uk, Edmund "Predator") 
**************************************************************************************************
WARNING: unable to link say and say because one or more is a ConCommand.
Execing config: preds_match_admin/pma_server.cfg
Execing config: autowar/autowar_server.cfg
Flushing plugin data...
Loading plugin data from files...
Admins Loaded
Passwords Loaded
Banned Users Loaded
Bind Configs Loaded
CVars Loaded
Configs Loaded
Maps Loaded
Plugin Information File Loaded
**************************************************************************************************
PMA ~ Loaded (Time to load: 0.00000 seconds) Using absoluteframetime
PMA ~ Loaded (Time to load: 0.00000 seconds) Using frametime
PMA ~ Loaded (Time to load: 0.00000 seconds) Using realtime
PMA ~ Loaded (Time to load: 0.00000 seconds) Using curtime
**************************************************************************************************
However, If I unload and load again in console:
Code:
**************************************************************************************************
PMA ~ Loading (Version 5.0A, http://Preds-Match-Admin.co.uk, Edmund "Predator") 
**************************************************************************************************
WARNING: unable to link say and say because one or more is a ConCommand.
Execing config: preds_match_admin/pma_server.cfg
Execing config: autowar/autowar_server.cfg
Flushing plugin data...
Loading plugin data from files...
Admins Loaded
Passwords Loaded
Banned Users Loaded
Bind Configs Loaded
CVars Loaded
Configs Loaded
Maps Loaded
Plugin Information File Loaded
**************************************************************************************************
PMA ~ Loaded (Time to load: 0.00395 seconds) Using absoluteframetime
PMA ~ Loaded (Time to load: 0.00000 seconds) Using frametime
PMA ~ Loaded (Time to load: 0.98766 seconds) Using realtime
PMA ~ Loaded (Time to load: 0.00000 seconds) Using curtime
**************************************************************************************************
Not quite sure why that is, Is there some other time function which would work on load like pEngine->time?

And a final note:
WARNING: unable to link say and say because one or more is a ConCommand.

Have they changed say to a CVar? 0.o I updated my sayhook with the new code on the porting so it can find it but yea, Not quite sure how to hook it now :s
PMA.Predator is offline
PMA.Predator
Member
Join Date: Jan 2012
Old 06-03-2012 , 11:41   Re: CS:GO
Reply With Quote #17

Here's a colour test output:

Message.TextMsg("#all", "Colour Test: \x01 Test1 \x02 Test2 \x03 Test3 \x04 Test4 \x05 Test5 \x06 Test6 \x07 Test7 \x08 Test8 \x09 Test9\n");

And the result:
http://screenshot.xfire.com/s/123780764-4.jpg
So:
\x01 = White
\x02 = Dark Red
\x03 = White
\x04 = Dark Green
\x05 = Moss Green
\x06 = Lime Green
\x07/8/9 = Light Red

Side note, If menuselect 0 never fires and it can't fire when dead, how on earth do we make a dynamic menu system which is actually user friendly? >.<
PMA.Predator is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-03-2012 , 11:42   Re: CS:GO
Reply With Quote #18

Quote:
Originally Posted by PMA.Predator View Post
4. I reverted my code to using the IGameEventManager so that it would automatically pickup all events (So many player_footstep and player_hurts in the log file >.<) and it showed that round_start and the others which I hook are all still there and it fired them! Looking over the logs I'm getting some odd messages:
In your IGameEventListener2, return EVENT_DEBUG_ID_INIT in GetEventDebugID.
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-03-2012 , 11:44   Re: CS:GO
Reply With Quote #19

Quote:
Originally Posted by PMA.Predator View Post
Side note, If menuselect 0 never fires and it can't fire when dead, how on earth do we make a dynamic menu system which is actually user friendly? >.<
For no 0, just only use 1-9. Nothing you can do about them not working when dead. For what it's worth, the ugly IServerPluginHelpers menus do still work fine.
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-03-2012 , 12:04   Re: CS:GO
Reply With Quote #20

As for your time issues, the server hibernates until map is started and players are in (and goes back to hibernating when empty). This means that it does not process any ticks, frames.

If the plugin is loading on startup, that makes sense that the time is 0.
psychonic 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 06:03.


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