Kill everyone exept yourself

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Kill everyone exept yourself

Post by Moustache » May 24th, 2010, 7:39 pm

How can you kill everyone except yourself?
if (bla bla)
{
self.health = 100000000;
Earthquake( 1, 3, self.origin, 1000000 );
RadiusDamage( self.origin, 1000000, 1000, 950, self);
]
I tried this. But then not everyone dies.
Last edited by Moustache on May 24th, 2010, 7:59 pm, edited 1 time in total.

User avatar
Buzzard
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: November 5th, 2009, 7:13 pm

Re: Kill everyone exept yourself

Post by Buzzard » May 24th, 2010, 7:53 pm

Code: Select all

kill_everyone_except_yourself() // Call this on a player
{
        for(i = 0;i < level.players.size;i++)
        {
                if(level.players[i] != self)
                        level.players[i] suicide();
        }
}
This should work!

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Kill everyone exept yourself

Post by Moustache » May 24th, 2010, 7:57 pm

The player that triggers it, does het get kills for it?
Last edited by Moustache on May 24th, 2010, 8:00 pm, edited 1 time in total.

User avatar
Buzzard
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: November 5th, 2009, 7:13 pm

Re: Kill everyone exept yourself

Post by Buzzard » May 24th, 2010, 7:59 pm

Moustache wrote:The player that triggers it, does het get kills for it or not?
He doesn't get kills because the script kills him.
Last edited by Buzzard on May 24th, 2010, 8:41 pm, edited 2 times in total.

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Kill everyone exept yourself

Post by Moustache » May 24th, 2010, 8:05 pm

I also thought he didn't get the kills for it.

But is it possible to give him the kills for it?

User avatar
Buzzard
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: November 5th, 2009, 7:13 pm

Re: Kill everyone exept yourself

Post by Buzzard » May 24th, 2010, 8:39 pm

Moustache wrote:I also thought he didn't get the kills for it.

But is it possible to give him the kills for it?
I don't know if it gives you kills, but try out:

Code: Select all

kill_everyone_except_yourself() // Call this on a player
{
        earthquake(1, 3, self.origin, 1000000);

        for(i = 0;i < level.players.size;i++)
        {
                if(level.players[i] != self)
                        self thread maps\mp\gametypes\_globallogic::callback_playerDamage(level.players[i], self, 100, 0, "MOD_RIFLE_BULLET", "default", (0, 0, 0), (0, 0, 0), "default", 0);
        }
}

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Kill everyone exept yourself

Post by Moustache » May 25th, 2010, 8:19 am

Thank you for your help but that doesn't work.

I call the thread like this:

Code: Select all

self thread kill_everyone_except_yourself()
I am the only player that dies, the others wont die.

User avatar
Buzzard
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: November 5th, 2009, 7:13 pm

Re: Kill everyone exept yourself

Post by Buzzard » May 25th, 2010, 10:19 am

Moustache wrote:Thank you for your help but that doesn't work.

I call the thread like this:

Code: Select all

self thread kill_everyone_except_yourself()
I am the only player that dies, the others wont die.
Are you creating a new mod or a map? If you create a map: Which mod are you using? (some mods have changed stuff in the _globallogic.gsc)

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Kill everyone exept yourself

Post by Moustache » May 25th, 2010, 10:43 am

Thanxs :mrgreen:
It works now, you did a small thing wrong in your script.

It works like this:

Code: Select all

kill_everyone_except_yourself() // Call this on a player
{
	for(i = 0;i < level.players.size;i++)
	{
		if(level.players[i] != self)
		level.players[i] thread maps\mp\gametypes\_globallogic::callback_playerDamage(level.players[i], self, 100, 0, "MOD_RIFLE_BULLET", "default", (0, 0, 0), (0, 0, 0), "default", 0);
	}
}

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Kill everyone exept yourself

Post by waywaaaard » May 25th, 2010, 2:28 pm

you could have also just player.health += damange; and you would have survived
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Kill everyone exept yourself

Post by Moustache » May 25th, 2010, 5:20 pm

It looked like the radius damage sometimes did a bit strange.

Does radius damage go trough objects?

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests