In this basic tutorial ill show you how to stuffcmd something. there's a lot of uses when using this so i think its a good tutorial.
ok to start off we need to have something to stuffcmd.
so lets make a function to print your name. just for something to use.
so i always like to make a new .qc file to put most of my custom stuff in and another for custom definitions so my way of doing things might be a little weird to some. but it helps me keep organized.
so first things first lets make a new .qc files called custom. in this file add your function to print your name like so:
Code: Select all
void() nameprint =
{
if (self.impulse == 15) // if self.impulse equals 15 .
centerprint(self,self.netname); // print my name in the center of the screen.
};
Code: Select all
if (self.impulse == 15) // sets self.impulse to 15
nameprint(); // and if its 15 calls our function.
next save and open up client.qc go down to "clientconnect" and in this function paste this:
Code: Select all
stuffcmd(self,"alias myname \"impulse 15\"\n");
stuffcmd(self,"bind m myname \n");
Code: Select all
void() nameprint ;
last step, open up progs.src and make it look like this:
Code: Select all
../progs.dat
defs.qc
moddefs.qc // added this
subs.qc
fight.qc
ai.qc
combat.qc
items.qc
weapons.qc
world.qc
client.qc
player.qc
monsters.qc
doors.qc
buttons.qc
triggers.qc
plats.qc
misc.qc
custom.qc // added this
ogre.qc
demon.qc
shambler.qc
knight.qc
soldier.qc
wizard.qc
dog.qc
zombie.qc
boss.qc
tarbaby.qc // registered
hknight.qc // registered
fish.qc // registered
shalrath.qc // registered
enforcer.qc // registered
oldone.qc // registered