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)

SAMURAI16 01-29-2009 12:53

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

Originally Posted by pheadxdll (Post 752252)
Anybody willing to take some screenshots of what these look like?

Thanks!

what ? :|

antihacker 03-10-2009 16:32

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Where can i find usermessages for L4D ?

Fyren 03-11-2009 09:40

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Do "meta game" in your server console. Not all messages are actually used/work/do anything.

antihacker 03-11-2009 10:27

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
thanks
+karma

DaFox 03-12-2009 09:19

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

Originally Posted by pheadxdll (Post 752252)
Anybody willing to take some screenshots of what these look like?

Thanks!

http://img24.**************/img24/961/03122009071849.png

ErF 03-21-2009 11:56

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
You can give all the code?

Thanks.

CrimsonGT 03-22-2009 21:54

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
Im a bit confused, I wrote a plugin that hooks all TF2 usermessages and creates a 0.1 second timer and then prints to chat when they are called. Some usermessages which I KNOW are being called are not printing out to chat. For example SayText2, I have another plugin that uses SayText2 but when I use it, nothing prints to chat.

I have...
Code:

HookUserMessage(GetUserMessageId("SayText2"), fn_SayText2, true);

public Action:fn_SayText2(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
    CreateTimer(0.1, Timer_SayText2);
}
public Action:Timer_SayText2(Handle:hndl)
{
    PrintToChatAll("UserMessage: SayText2 was Called");
}

My other question is how the hell do you find out what the args for a usermessage are? The first post says it will be covered later but never goes over it so im a bit clueless.

SAMURAI16 03-23-2009 08:46

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
by guessing
BfReadByte(bf) -> see if return a value
if no
BfReadChar(bf) and so on untill you get a value

Let's say if find a char. That means first argument is a char. Now you have to do
BfReadChar(bf)
BfReadByte(bf) -> if returns something is good, else again

BfReadChar(bf)
BfReadChar(bf) -> returns something ? if yes that means 2nd argument is char also

psychonic 03-23-2009 08:49

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

Originally Posted by CrimsonGT (Post 786904)
Im a bit confused, I wrote a plugin that hooks all TF2 usermessages and creates a 0.1 second timer and then prints to chat when they are called. Some usermessages which I KNOW are being called are not printing out to chat. For example SayText2, I have another plugin that uses SayText2 but when I use it, nothing prints to chat.

My other question is how the hell do you find out what the args for a usermessage are? The first post says it will be covered later but never goes over it so im a bit clueless.

Not sure why your hook isn't working. That's the only way I know of to get a good guess of the format, but this is what I use for SayText2 in TF2

PHP Code:

    BfWriteByte(hBfclientid); 
    
BfWriteByte(hBf0); 
    
BfWriteString(hBfmessage);
    
EndMessage(); 

Use \x03 in the message for the team color of the specified clientid.

SAMURAI16 03-23-2009 09:18

Re: [Tutorial] Usermessages : list, ussage, bitbuffer structure
 
that's sending a message, not hooking


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

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