Raised This Month: $89 Target: $400
 22% 

MRecipient Filter for CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 08-25-2012 , 19:28   MRecipient Filter for CS:GO
Reply With Quote #1

Trying to port a MetaMod:Source plugin from CS:S to CS:GO. Seems like there are changes to the interface that is used by the old MRecipient Filter.

Does anyone have an updated one working for CS:GO? I looked but didn't find answers to all the questions.

Thanks.
__________________
.......Chuck |TxA| Old and Slow [AARP]
Old and Slow is offline
Ajaxx
Senior Member
Join Date: Oct 2009
Old 08-25-2012 , 23:29   Re: MRecipient Filter for CS:GO
Reply With Quote #2

What error are you receiving? Donít know if you saw earlier but in MRecipientFilter.cpp I was having a problem with
Code:
edict_t *pPlayer = engine->PEntityOfEntIndex(i)
asherkin suggested I replace with
Code:
edict_t* pPlayer = (edict_t *)(gpGlobals->pEdicts + i)
that worked for me.
Ajaxx is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 08-26-2012 , 05:32   Re: MRecipient Filter for CS:GO
Reply With Quote #3

Code:
make -f Makefile dmg_mm
MRecipientFilter.cpp: In member function virtual int MRecipientFilter::GetRecipientCount() const:
MRecipientFilter.cpp:17: error: const class CUtlVector<int, CUtlMemory<int, int> > has no member named Size
MRecipientFilter.cpp: In member function void MRecipientFilter::AddAllPlayers():
MRecipientFilter.cpp:37: error: class IVEngineServer has no member named PEntityOfEntIndex
MRecipientFilter.cpp: In member function void MRecipientFilter::AddRecipient(int):
MRecipientFilter.cpp:57: error: class IVEngineServer has no member named PEntityOfEntIndex
make[1]: *** [Debug.csgo/MRecipientFilter.o] Error 1
make: *** [all] Error 2
Your fix should take care of the last 2. Not sure about the "Size" one - I didn't see any differences in public/irecipientfilter.h and this compiled using the CSS HL2SDK...

Also, how did you resolve the "Say" message? It appears that engine->UserMesageBegin() has changed. Did its use change as well?

I used this:

Code:
void DmgPlugin::SayText (                       //say text to individual player
    int         aIndex,                         //player index, 1::max
    const char  *aSzMsg)                        //message
{
    char *message = NULL;
    message = (char*) malloc(strlen(aSzMsg)+4);
    sprintf(message, "%s \n", aSzMsg);

    MRecipientFilter mrf;
    mrf.AddRecipient(aIndex);
    int msg_type = 3;                           //SayText
    bf_write *msg = engine->UserMessageBegin((IRecipientFilter *)&mrf, msg_type);

    msg->WriteByte(aIndex);
    msg->WriteString(message);
    msg->WriteByte(0);
    engine->MessageEnd();
    free(message);
}
Is it still valid?

Thanks for your help.
__________________
.......Chuck |TxA| Old and Slow [AARP]

Last edited by Old and Slow; 08-26-2012 at 05:33.
Old and Slow is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 08-26-2012 , 05:41   Re: MRecipient Filter for CS:GO
Reply With Quote #4

Quote:
Not sure about the "Size" one - I didn't see any differences in public/irecipientfilter.h and this compiled using the CSS HL2SDK...
Looks like there was a warning not to use Size() because it was depricated in the CSS version - in public/tier1/utlvector.h

So, that's fixed by using Count() instead.
__________________
.......Chuck |TxA| Old and Slow [AARP]

Last edited by Old and Slow; 08-26-2012 at 05:42.
Old and Slow is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 08-26-2012 , 17:20   Re: MRecipient Filter for CS:GO
Reply With Quote #5

OK, I looked in the source for SourceMod - UserMessages.cpp and found the correct call for UserMessageBegin(). Looks like the plug-in is sending out "say" commands as it should.
__________________
.......Chuck |TxA| Old and Slow [AARP]
Old and Slow 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 00:49.


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