Yoo, I'm kinda new here(in the forum and quake c), I'm using darkplaces and trying to do a crouch for the player be able to go on the small places, the only problem with my crouch thing, is that if you just stop pressing ctrl button, on small place it just stop moving and able to jump(if you do that, you gonna be stuck forever (), I want to know if have a over collision of the player to fix that, or another way to do it, here's my script:
crouch.qc:
////////////////////////////////////////
////////////////////////////////////////
/* Crouch, Probably; */
////////////////////////////////////////
////////////////////////////////////////
// Crouch Down.
void() PlayerCrouchDown =
{
if(self.flags & FL_ONGROUND)
{
self.crouch = 1;
}
if(self.crouch == 1)
{
setsize(self, VEC_ORIGIN, VEC_ORIGIN);
}
}
// Crouch Up.
void() PlayerCrouchUp =
{
if(self.flags & FL_ONGROUND)
{
self.crouch = 0;
}
if(self.crouch == 0)
{
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
}
}
client.qc:
if(!self.crouch)
{
if (self.button2)
{
PlayerJump ();
}
else
{
self.flags = self.flags | FL_JUMPRELEASED;
}
}
if(self.button3)
{
PlayerCrouchDown ();
}
else
{
PlayerCrouchUp ();
}
crouch.qc:
////////////////////////////////////////
////////////////////////////////////////
/* Crouch, Probably; */
////////////////////////////////////////
////////////////////////////////////////
// Crouch Down.
void() PlayerCrouchDown =
{
if(self.flags & FL_ONGROUND)
{
self.crouch = 1;
}
if(self.crouch == 1)
{
setsize(self, VEC_ORIGIN, VEC_ORIGIN);
}
}
// Crouch Up.
void() PlayerCrouchUp =
{
if(self.flags & FL_ONGROUND)
{
self.crouch = 0;
}
if(self.crouch == 0)
{
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
}
}
client.qc:
if(!self.crouch)
{
if (self.button2)
{
PlayerJump ();
}
else
{
self.flags = self.flags | FL_JUMPRELEASED;
}
}
if(self.button3)
{
PlayerCrouchDown ();
}
else
{
PlayerCrouchUp ();
}
Comment