Hi Sebastian, try using this instead.
if( infokey(self, "t_footsteps") != "0" )
This should work. What this does is to make it so you don't have to have
the variable present in your autoexec.cfg or mod.cfg files in order to
work. You'd then also accompany this code with the following, which you
can place in your hooks.qc file. You can obviously change the impulse and
msgs to your liking.
if(self.impulse == 85)
{
if(infokey(self, "t_footsteps") == "0")
{
stuffcmd(self, "setinfo t_footsteps 1\n");
snap_misc_m2m("Random Footsteps On\n");
safe_soundtoclient(self, self, CHAN_VOICE, "toggles/on.wav",
1, ATTN_NORM);
}
else
{
stuffcmd(self, "setinfo t_footsteps 0\n");
snap_misc_m2m("Standard Footsteps On\n");
safe_soundtoclient(self, self, CHAN_VOICE, "toggles/off.wav",
1, ATTN_NORM);
}
}
This way, when you then bind the impulse you set above to a key, or type
in into the console, you'll be able to toggle the footsteps between the two
settings.
I hope this helps. And if I'm not understanding your question clearly,
then please feel free to write again.
Have a great evening and please let me know how it goes...
Smiles,
Cara
At 10:56 PM 7/30/2006 +0200, you wrote:
Hoppa AGRIP readers,
I'm very confused. :-(
I want to put into random footsteps. This will be work, but I have one
problem.
When I put into the code from www.inside3d.com all works fine. But I
want to change between the aq original footsteps and the random
footsteps.
When I use the following Code in the player.qc, I hear the footsteps of the
bots and my own too:
void() player_run =[ $rockrun1, player_run ]
{
// begin aqtourn
// begin random footsteps by ze0
if (self.walkframe == 1 || self.walkframe == 4 )
{
if (checkbottom(self) == 1)
{
if (self.waterlevel == 0)
{
local float r;
r = rint(random() *
3);
if (r == 1)
sound (self, CHAN_AUTO,
"player/foot1.wav", 0.5, ATTN_NORM);
else if (r == 2)
sound (self, CHAN_AUTO,
"player/foot2.wav", 0.5, ATTN_NORM);
else if (r == 0)
sound (self, CHAN_AUTO,
"player/foot3.wav", 0.5, ATTN_NORM);
else
sound (self, CHAN_AUTO,
"player/foot4.wav", 0.5, ATTN_NORM);
}
}
}
//}
// end random footsteps by ze0
self.weaponframe=0;
if (!self.velocity_x && !self.velocity_y)
{
self.walkframe=0;
player_stand1();
return;
}
if (self.weapon == IT_AXE)
{
if (self.walkframe >= 6)
self.walkframe = 0;
self.frame = $axrun1 + self.walkframe;
}
else
{
if (self.walkframe >= 6)
self.walkframe = 0;
self.frame = self.frame + self.walkframe;
}
self.walkframe = self.walkframe + 1;
#ifdef AGRIP
agh_player_footsteps();
#endif
}
But, I want to select between old version of footsteps, new version
and no footsteps.
In the player.qc I use the following:
void() player_run =[ $rockrun1, player_run ]
{
// begin aqtourn
// begin random footsteps by ze0
if( infokey(self, "t_footsteps") == "1" )
{
if (self.walkframe == 1 || self.walkframe == 4 )
{
if (checkbottom(self) == 1)
{
if (self.waterlevel == 0)
{
local float r;
r = rint(random() *
3);
if (r == 1)
sound (self, CHAN_AUTO,
"player/foot1.wav", 0.5, ATTN_NORM);
else if (r == 2)
sound (self, CHAN_AUTO,
"player/foot2.wav", 0.5, ATTN_NORM);
else if (r == 0)
sound (self, CHAN_AUTO,
"player/foot3.wav", 0.5, ATTN_NORM);
else
sound (self, CHAN_AUTO,
"player/foot4.wav", 0.5, ATTN_NORM);
}
}
}
//}
// end random footsteps by ze0
// end aqtourn
self.weaponframe=0;
if (!self.velocity_x && !self.velocity_y)
{
self.walkframe=0;
player_stand1();
return;
}
if (self.weapon == IT_AXE)
{
if (self.walkframe >= 6)
self.walkframe = 0;
self.frame = $axrun1 + self.walkframe;
}
else
{
if (self.walkframe >= 6)
self.walkframe = 0;
self.frame = self.frame + self.walkframe;
}
self.walkframe = self.walkframe + 1;
#ifdef AGRIP
agh_player_footsteps();
#endif
}
--
The problem is, that I heare my own footsteps, but the footsteps of
the others doesn't work. :-(
When I use the
if( infokey(self, "t_footsteps") == "1" )
I hear only my own footsteps. When I use this not, I heare my own and
the other footsteps.
Can everybody tell me what happens?
Thanks and
Best regards Sebastian
ICQ: 264706583 / MSM: [EMAIL PROTECTED]
Yahoo: de_sebo / Skype: sebo_de
E-Mail: [EMAIL PROTECTED] / Web: www.aritamba.de
_______________________________________________
AGRIP-discuss mailing list
[email protected]
http://lists.agrip.org.uk/cgi-bin/mailman/listinfo/agrip-discuss
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/403 - Release Date: 7/28/2006
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/404 - Release Date: 7/31/2006
_______________________________________________
AGRIP-discuss mailing list
[email protected]
http://lists.agrip.org.uk/cgi-bin/mailman/listinfo/agrip-discuss