.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Messaging system (http://forums.bots-united.com/showthread.php?t=751)

InternetNightmare 13-02-2004 18:57

Messaging system
 
Well sending messige is something like taht:
Quote:

MESSAGE_BEGIN(MSG_ONE, Msg, NULL, pl->edict());
WRITE_BYTE(Byte);
WRITE_STRING(Textorsmth);
MESSAGE_END();
But were do I find message list for Health and... (I have VGUI message list) for MOD? Maybe I should ask creators? It's not a Half-Life (msgs are in SDK :) )

Pierre-Marie Baty 13-02-2004 19:07

Re: Messaging system
 
If you use metamod, you can use the GET_USER_MSG_ID (PLID, "Health", NULL); macro to get the message ID for Health messages.

If you don't use metamod, you have to keep track yourself of who's who, by hooking pfnRegUserMsg() and checking the return values. pfnRegUserMsg() is called by the MOD when the server boots up so that the MOD can register its network messages to the engine ; the engine replies back with a message ID that will be associated to that message name. By hooking this function you can build yourself a table where you'll look up which message ID corresponds to which message name, and vice versa.

BTW, learning everything that is to learn in the world is a really nice hobby. Keep it up ;)

InternetNightmare 13-02-2004 19:22

Re: Messaging system
 
Thanks! I'm using MetaMOD! Well and current step of learning everything is HL SDK. I already know many things, especialy about PCs. :)
And if you know some good MetaMOD coding links, feel free to share... :)

InternetNightmare 13-02-2004 19:28

Re: Messaging system
 
Oh about good is REAL... Thats a good joke ;)

InternetNightmare 13-02-2004 19:36

Re: Messaging system
 
Quote:

These are old metamod plugins for very old game called Half-Life and I have stopped wasting all of my time coding/supporting theim.
Is he stuipid or what!?

Pierre-Marie Baty 13-02-2004 20:25

Re: Messaging system
 
please stop spamming, though. Consider editing your posts to save space.

BAStumm 18-02-2004 08:02

Re: Messaging system
 
wouldn't it be simpler to check indexent->v.health if you want to know health rather than intercepting the messages? or pPlayer->v.health or whatever you prefer to call it....

Pierre-Marie Baty 18-02-2004 09:26

Re: Messaging system
 
he does not want to KNOW the health... he wants to SET it. Nuance :)

botmeister 18-02-2004 23:35

Re: Messaging system
 
To change the health of a player, just do this:

pPlayer->v.health = new_heath;

but you guys must already know this?

Pierre-Marie Baty 19-02-2004 02:50

Re: Messaging system
 
tsk tsk tsk botmeister...

this is NOT sufficient :)

Read the beginning of the post :)

*edit* silly me, the explanation lies in another thread... hold on, lemme look it up
...ah, here it is: http://forums.bots-united.com/showthread.php?t=724


All times are GMT +2. The time now is 13:34.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.