Code: Select all
if (monsters_killed = 10)
{
something happens
};Code: Select all
if (monsters_killed = 10)
{
something happens
};Code: Select all
void() zombie_die =
{
sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_zombie.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
};I am not so sure about printing a message to the player, coming from a Zombie death, but I know a way to do it.void() zombie_die =
{
if (killed_monsters == 10) //Plays a sound if a Zombie is killed
sound (self, CHAN_VOICE, "zombie/z_miss.wav", 1, ATTN_NORM)
sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_zombie.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
};
Add your code Somewhere after this:/*
================
PlayerPreThink
Called every frame before physics are run
================
*/
void() PlayerPreThink =
Maybe do something like this:if (self.deadflag >= DEAD_DEAD)
{
PlayerDeathThink ();
return;
}
FYI: The last method Is more temporary. In my opinion, it isn't good to clutter player_pre_think because it is kinda memory intensive./*
================
PlayerPreThink
Called every frame before physics are run
================
*/
void() PlayerPreThink =
{
if (BotPreFrame()) // FrikBot
return;
if (intermission_running)
{
IntermissionThink (); // otherwise a button could be missed between
return; // the think tics
}
if (self.view_ofs == '0 0 0')
return; // intermission or finale
makevectors (self.v_angle); // is this still used
CheckRules ();
WaterMove ();
if (self.waterlevel == 2)
CheckWaterJump ();
}
if (self.deadflag >= DEAD_DEAD)
{
PlayerDeathThink ();
return;
}
if (self.deadflag == DEAD_DYING)
return; // dying, so do nothing
if (killed_monsters == 10)
centerprint (self, "10 Monster are outta this world!\n");
if (self.button2)
{
PlayerJump ();
}
else
self.flags = self.flags | FL_JUMPRELEASED;
// teleporters can force a non-moving pause time
if (time < self.pausetime)
self.velocity = '0 0 0';
if(time > self.attack_finished && self.currentammo == 0 && self.weapon != IT_AXE)
{
//self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
}
};
Man, you need to learn more about Quakec. The definition is a float that applies to the world, and it is actually killed_monsters. You need to figure some stuff out. I will fix the Function to suit the definition. I was just going more off what you were saying.ThePlasticBling wrote:it says unkown value "monsters killed"
This should be == not = anyway. You are assigning the value of '10' to the variable 'monsters_killed' when you should be comparing the values with the double equals sign.ThePlasticBling wrote:if (monsters_killed = 10)