AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [Tutorial] Usermessages : list, ussage, bitbuffer structure (https://forums.alliedmods.net/showthread.php?t=80256)

psychonic 03-23-2009 09:38

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Quote:

Originally Posted by SAMURAI16 (Post 787109)
that's sending a message, not hooking

I was getting the impression that he was hooking it to figure out how it works because his plugin that sends was not working
Quote:

Originally Posted by CrimsonGT
I have another plugin that uses SayText2 but when I use it, nothing prints to chat.


CrimsonGT 03-23-2009 09:38

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Thanks Samurai,

and yeah, im not actually trying to find the SayText2 stuff, I just tested to see if my hooks were actually working which apparently they arent. (I hooked all of the TF2 usermessages) and I just tried out saytext and saytext2 and neither one worked so im a bit confused as to why the hooks arent being called on them when they are obviously being used.

Dragonshadow 08-14-2009 09:54

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Quote:

Originally Posted by p3tsin (Post 750688)
It seems even CSS never fires that usermessage. You can do the progress bar with these 2 netprops though

Code:

CCSPlayer::m_iProgressBarDuration (byte)
CCSPlayer::m_flProgressBarStartTime (float)

Set starttime to GetGameTime() and duration to number of seconds you want it to last. Apparently you gotta reset the value of m_iProgressBarDuration to 0 manually when the time has ran out.

I know this is an old thread, but is there anything like this in tf2?

Wazz 08-14-2009 20:33

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Your only chance is the using the developers commentary. I have no further help I can give though, good luck :)

flud 04-29-2010 20:21

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
any chance to see some example for l4d2 ?

KawMAN 05-01-2010 11:22

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
This can be useful
PHP Code:

decl String:strRest[256]="";
decl String:strRestc[256]="";
new 
curbyte;
while(
BfGetNumBytesLeft(hBitBuffer))
{
    
curbyte BfReadByte(hBitBuffer);
    
Format(strRestsizeof(strRest), "%s%d"strRestcurbyte);
    
Format(strRestcsizeof(strRestc), "%s%c"strRestccurbyte);
}
PrintToServer("USERMSGHOOK: %s "strRest);
PrintToServer("USERMSGHOOK: %s "strRestc); 

also Name Change Message Block if
PHP Code:

public OnPluginStart()
{    
    
HookUserMessage(GetUserMessageId("SayText2"), UserMessageHooktrue);
}

public 
Action:UserMessageHook(UserMsg:MsgIdHandle:hBitBuffer, const iPlayers[], iNumPlayersbool:bReliablebool:bInit)
{
    
decl String:strMessage[256]="";

    
// Skip the first two bytes
    
BfReadByte(hBitBuffer);
    
BfReadByte(hBitBuffer);
    
    
// Read the message
    
BfReadString(hBitBufferstrMessagesizeof(strMessage), true);
    
//Next BfReadString is prev name, next is current name (changed to)
    
    //#Cstrike_Name_Change
    
if (StrEqual(strMessage"#Cstrike_Name_Change")) 
    {

        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;



Soldier.Zi 05-23-2022 16:58

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Sorry for refreshing so old thread, but i want to ask where I can find list of all user messages for CS:GO?


All times are GMT -4. The time now is 23:42.

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