D00d you forgot DECLARE_MESSAGE(blah, blah); in that cp file.
and maybe you didn't make an instance of the hud variable and call its init
func.
----- Original Message -----
From: Tom <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2002 7:30 AM
Subject: [hlcoders] Message Problems
> Im having some problems sending over a message, it seems to not like
> anything. Ive spent now about 3 hours trying to get it to work!!
>
> this is my code:
>
> player.cpp:
> ...
> int gmsgTeams = 0;
> int gmsgZone = 0;
>
> ...
> gmsgVGUIMenu = REG_USER_MSG("VGUIMenu", 1);
> gmsgZone = REG_USER_MSG("zones", -1);
>
> in zone.cpp:
>
> extern int gmsgZone;
> MESSAGE_BEGIN( MSG_ALL, gmsgZone);
> WRITE_BYTE( no );
> WRITE_COORD( pev->mins.x );
> WRITE_COORD( pev->mins.y );
> WRITE_COORD( pev->mins.z );
> WRITE_COORD( pev->maxs.x );
> WRITE_COORD( pev->maxs.y );
> WRITE_COORD( pev->maxs.z );
> MESSAGE_END();
>
> in hud.cpp on client:
> int __MsgFunc_zones(const char *pszName, int iSize, void *pbuf)
> {
> return gHUD.m_Zone.MsgFunc_Zone( pszName, iSize, pbuf );
> }
> HOOK_MESSAGE( zones );
>
> in zone.cpp clientside
>
> int CHudZone::MsgFunc_Zone(const char *pszName, int iSize, void *pbuf )
> {
> BEGIN_READ( pbuf, iSize );
> zones[zno].no = (int)READ_BYTE();
> for (int i=0 ; i<3 ; i++)
> zones[zno].min[i] = READ_COORD();
> for (i=0 ; i<3 ; i++)
> zones[zno].max[i] = READ_COORD();
> zno++;
> return 1;
> }
>
> but when I run it I always just get
>
> PF_MessageEnd_I: Unknown User Msg 100
>
> Any ideas?
>
> I even tried making
> gmsgZone = REG_USER_MSG("zones", -1);
> into gmsgZone = REG_USER_MSG("VGUIMenu", -1); but then I still got the
> error!
>
> Thanks in advance
> --tom
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders