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

Third-Party Mod User Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 09-24-2010 , 22:25   Third-Party Mod User Messages
Reply With Quote #1

Is there an easy and reliable way to find messages for third-party mods and the bytes you can send with them?
Spunky is offline
Send a message via AIM to Spunky
psychonic

BAFFLED
Join Date: May 2008
Old 09-24-2010 , 22:31   Re: Third-Party Mod User Messages
Reply With Quote #2

Quote:
Originally Posted by Spunky View Post
Is there an easy and reliable way to find messages for third-party mods and the bytes you can send with them?
You can get the names of the messages with "meta game".

For any that don't match the sdk/other games, you would have to use one of trial and error, hooking/reversing, or disassembling the binary.
psychonic is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 09-25-2010 , 00:17   Re: Third-Party Mod User Messages
Reply With Quote #3

Thanks a lot, that's awesome. What about the bytes you send with them? Just trial and error on that?
Spunky is offline
Send a message via AIM to Spunky
Monkeys
Veteran Member
Join Date: Jan 2010
Old 09-25-2010 , 05:38   Re: Third-Party Mod User Messages
Reply With Quote #4

Quote:
Originally Posted by Spunky View Post
Thanks a lot, that's awesome. What about the bytes you send with them? Just trial and error on that?
Yhep.
Here's a good snippet for it, it prints the buffer in both bytes and chars.
Can't remember who wrote it. Was in some topic discussing the very same.
PHP Code:
decl String:strRest[256]="";
    
decl String:strRestc[256]="";
    
decl String:strUserMessageName[256]="";
    
GetUserMessageName(msg_idstrUserMessageNamesizeof(strUserMessageName));
    new 
curbyte;
    while(
BfGetNumBytesLeft(hBitBuffer))
    {
        
curbyte BfReadByte(hBitBuffer);
        
Format(strRestsizeof(strRest), "%s%d"strRestcurbyte);
        
Format(strRestcsizeof(strRestc), "%s%c"strRestccurbyte);
    }
    
PrintToChatAll("%s: %s "strUserMessageNamestrRest);
    
PrintToChatAll("%s: %s "strUserMessageNamestrRestc); 
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 09-25-2010 , 13:16   Re: Third-Party Mod User Messages
Reply With Quote #5

Where is hBitBuffer declared in that snippet?

Nevermind. x_x

Last edited by Spunky; 09-25-2010 at 13:19.
Spunky is offline
Send a message via AIM to Spunky
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 09-25-2010 , 15:30   Re: Third-Party Mod User Messages
Reply With Quote #6

hBitBuffer is just the handle to the user message.
bl4nk is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 09-25-2010 , 16:46   Re: Third-Party Mod User Messages
Reply With Quote #7

What bl4nk said.
You hook the usermessage you want to read and use the above snippet.

So if you want to hook XboxRumble, it'd look like this:
PHP Code:
public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("XBoxRumble"), UM_Hookfalse);    // Send a rumble to XBox controller
}

public 
Action:UM_Hook(UserMsg:msg_idHandle:hBitBuffer, const players[], playersNumbool:reliablebool:init)
{
    
decl String:strRest[256]="";
    
decl String:strRestc[256]="";
    
decl String:strUserMessageName[256]="";
    
GetUserMessageName(msg_idstrUserMessageNamesizeof(strUserMessageName));
    new 
curbyte;
    while(
BfGetNumBytesLeft(hBitBuffer))
    {
        
curbyte BfReadByte(hBitBuffer);
        
Format(strRestsizeof(strRest), "%s%d"strRestcurbyte);
        
Format(strRestcsizeof(strRestc), "%s%c"strRestccurbyte);
    }
    
PrintToChatAll("%s: %s "strUserMessageNamestrRest);
    
PrintToChatAll("%s: %s "strUserMessageNamestrRestc);
    return 
Plugin_Continue;

__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys 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 09:24.


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