View previous topic :: View next topic |
Author |
Message |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Nov 19, 2007 1:35 am Post subject: |
|
|
Thanks guys, I'll give it a shot!  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
daemon

Joined: 07 Nov 2007 Posts: 62
|
Posted: Mon Nov 19, 2007 3:53 am Post subject: |
|
|
This is what I had in mind, but you can use whatever works for you:
Code: | 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 ] |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Nov 19, 2007 7:07 am Post subject: |
|
|
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  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|