Death timer?
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Death timer?
Guys once again I am in a bind.
I'm trying to get a timer started when the player dies and stops when the player respawns and grabs his first item.
In Clientobituary() I tried:
Stopping the timer would be easy, so I don't need help with that part.
Any suggestions?
I'm trying to get a timer started when the player dies and stops when the player respawns and grabs his first item.
In Clientobituary() I tried:
- Code: Select all
targ.deathtimer = time + 3; //(I want my actions to take place 3 seconds after death)
if (targ.deathtimer == time)
if (targ.netname == "redrum")
stuffcmd(targ, "say nice shot!\n");
Stopping the timer would be easy, so I don't need help with that part.
Any suggestions?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
I'm new to QuakeC but would:
Be any more reliable? Checking for == with floats is often bad news in C based languages.
- Code: Select all
if (targ.deathtimer >= time)
Be any more reliable? Checking for == with floats is often bad news in C based languages.
- Willem
- Posts: 73
- Joined: Wed Jan 23, 2008 10:58 am
ClientObituary() is only called after a player is killed... if you check for that in there it won't work properly.
Remove the time check but keep this line and add another after it:
and put this new one in PlayerPreThink():
And at the very top of the file, add this line:
And it should work.
Remove the time check but keep this line and add another after it:
- Code: Select all
targ.deathtimer = time + 3;
targ.dontloop = 0;
and put this new one in PlayerPreThink():
- Code: Select all
if (self.deathtimer < time)
if (damage_attacker != self)
if (!self.dontloop)
{
self.dontloop = 1;
stuffcmd (self, "say nice shot!\n");
}
And at the very top of the file, add this line:
- Code: Select all
.float dontloop;
And it should work.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 1 guest