Quake DeveLS - Cloaking

Author: JohnRittenhouse
Difficulty: Damn easy !

Wheeee !...

For all you snipers out there, i've whipped up this little bit of code to add cloaking to your mod. It lets you cloak if you aren't moving, and if you do, you become visible again.Here goes! First, open up g_cmds.c and go down to the bottom of the clientcommand code. Now add thecode so it looks like this:

        else if (Q_stricmp (cmd, "wave") == 0)		Cmd_Wave_f (ent);
	+//New command for cloaking	+else if (Q_stricmp (cmd, "cloak") == 0)  
        +{	+	if (ent->svflags & SVF_NOCLIENT)               +       {
        +               gi.cprintf (ent, PRINT_HIGH, "You are nowvisible!\n");
        +               ent->svflags -= SVF_NOCLIENT;        +       }
        +       else        +       {
        +               gi.cprintf (ent, PRINT_HIGH, "You are nowcloaked!\n");
        +               ent->svflags |= SVF_NOCLIENT;        +       }        +}
What this lets you do is become cloaked and uncloaked with the command "cloak". But this would be impossible to play with because everyone would just be invisible, so add this next piece of code to p_client.c around line 1500 so it looks like this:

		VectorCopy (pm.viewangles, client->v_angle);
		VectorCopy (pm.viewangles, client->ps.viewangles);	}
+if (ucmd->forwardmove != 0 ||  ucmd->sidemove  != 0 && ent->svflags &
SVF_NOCLIENT)+{+	ent->svflags &= ~SVF_NOCLIENT;+}	gi.linkentity (ent);
What this does is turn cloaking off if you move. We can't have invisible people running around you know! To use it all you have to do is type in "cmd cloak".

Will Roberson .

This site, and all content and graphics displayed on it,
are Šopyrighted to the Quake DeveLS team. All rights received.
Got a suggestion? Comment? Question?Hate mail? Send it to us!
Oh yeah, this site is best viewed in 16 Bit or higher, with the resolution on 800*600.
Thanks to Planet Quake for their great help and support with hosting.
Best viewed with Netscape 4