lfnetwork.com mark read register faq members calendar

Thread: How can I make BUTTON_ATTACK as if pressed in cgame?
Thread Tools Display Modes
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Prev Previous Post   Next Post Next
Old 06-22-2006, 08:15 PM   #1
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
How can I make BUTTON_ATTACK as if pressed in cgame?

I have made a command in g_cmds.c that needs the game to make like BUTTON_ATTACK has been pressed without the player really doing so.

in bg_pmove.c, within PM_Weapon, I have the following:

Code:
#ifdef QAGAME
	if (g_entities[pm->ps->clientNum].client->vsnSaberCombat.swingingSaber == qtrue)
		{
		pm->cmd.buttons |= BUTTON_ATTACK;
		}
#endif
As you can see it's only in QAGAME so it works fine if my client is the same as my server like when I run it as a non-dedicated listening server, but doesn't work for any clients when I run the code on a dedicated server.

How can I make the cgame also virtually press BUTTON_ATTACK at the same time?

PS.:

I tried out ways that avoided using #ifdef QAGAME but it didn't seem to help. "cmd.buttons |= BUTTON_ATTACK" still didn't work from cgame files though I tried it in various places. As it is now the QAGAME version is back since it's more convenient in other ways.
Vruki Salet is offline   you may: quote & reply,
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > How can I make BUTTON_ATTACK as if pressed in cgame?

Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:54 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.