"You've got the lead"
Moderator: InsideQC Admins
33 posts
• Page 3 of 3 • 1, 2, 3
This is what I had in mind, but you can use whatever works for you:
- Code: Select all
void(entity ent, float amount)Frag =
{
local entity oldleader;
local float tie;
oldleader = leader;
ent.frags = ent.frags + amount;
if(!deathmatch)
return;
head = nextent(world);
while(head)
{
if(head.flags & FL_CLIENT)
{
if(head.frags == leader.frags)
tie = TRUE;
else
if(head.frags > leader.frags)
{
leader = head;
tie = FALSE;
}
}
head = nextent(head);
}
if(tie)
{
head = nextent(world);
while(head)
{
if(head.flags & FL_CLIENT && head.frags == leader.frags)
sprint(head, "You're tied for the lead.\n");
head = nextent(head);
}
}
else
if(leader != oldleader)
{
sprint(leader, "You've got the lead.\n");
if(oldleader.flags & FL_CLIENT)
sprint(oldleader, "You've lost the lead.\n");
}
};
-daemon [ daemonforge.org ]
-

daemon - Posts: 63
- Joined: Wed Nov 07, 2007 11:10 pm
Thanks for your help Daemon. It helped me learn!
Thats what I need. I still didn't grasp the whole thing though but thats ok. I got it working fairly well. I'll implement your code and let you know how it goes. I'm leaving for vacation in the morning, so it'll be awhile until I can test it.
Thanks again
Thats what I need. I still didn't grasp the whole thing though but thats ok. I got it working fairly well. I'll implement your code and let you know how it goes. I'm leaving for vacation in the morning, so it'll be awhile until I can test it.
Thanks again
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
33 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest