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