Temp Invincibility During Respawn

 

 

philip
profile | email

posted 09-07-98 1:38 PM CT (US)
Title: Temp Invincibility During Respawn Add-On
By: Philip (aka Maj.Bitch)
Difficulty: Extremely Easy!!
Email: peblair@gv.net // please report any bugs(??)
Date: 9-06-98
Note: Please give credit where credit is due.

=============================================================
During Deathmatch play, it is NOT uncommon for lamers to be firing directly into respawners (especially on infinite ammo servers) because they see a player's teleport effect happening and they know that a helpless player is about to materialize there quite soon. (I know, I've done it myself! I'm not proud of it! But, that's between me and my therapist!! haha)

Anyway, several people have asked how to add some invincibility during a respawn. I wanted to do that myself to my code so I looked into it and found that all you have o do is add 1 simple stinking little line to the respawn() function and you're done!

So, here it is:

============
Find the respawn() function in your code (my functions have been all moved around so I'm not sure where your's is)..

Anyway, inside of the following function:

void respawn(edict_t *self) {

// Do this to add 3 seconds worth of invincibility.
self->client->invincible_framenum = level.framenum + 30; // 10 frames per second.

=============

The gaming engine will keep the player invincible to any kind of damage until the level's frame numbering system (like level.time) catches up with the player's invinciblility framenumber..

Okay, now that's EASY!

And, when you're done respawning, go kill all those bastards!!

regards,
Maj.Bitch

cr0tan
profile | email

posted 09-07-98 5:50 PM CT (US)
Thanx for the code. But here's an extra bit of code to put in for spawning invincible.

Still in "p_client.c" go to the "void ClientBeginDeathmatch (edict_t *ent)" and at the end of this function put this line in, just after "ClientEndServerFrame(ent);", "ent->client->invincible_framenum = level.framenum + 30;". That will make u and the other players invincible at spawn. The one above covers respawn.

cr0tan