PDA

View Full Version : Kill the mates too



Loveboy
29th December 2013, 22:14
Hello Guys!
I am working on a nuke script and I want to ask you how to kill not only the enemys, I want that the teammates die too.

I already tried to do teamkill on but it doesn't help, my teammates doesn't die.

On this part the enemys die:



players = getentarray("player","classname");
for(i = 0; i < players.size; i++);
{
players[i] thread [[level.callbackPlayerDamage]](players[i], self, 10000, 1, "MOD_GRENADE", "nuke_mp", players[i].origin, players[i].origin, "none", 0);
}


Do you know how to kill the teammates by the nuke too?

Tally
29th December 2013, 22:28
players = getentarray("player","classname");
for(i = 0; i < players.size; i++);
{
players[i] suicide();
}

Loveboy
29th December 2013, 23:54
Yes I know it already, but I want that the players get killed by a weapon, because there is the Nuke hud and the player who killed somebody, so the player kills all players (teammates too).

IzNoGoD
30th December 2013, 01:24
sooooo
did you EVER EVER look at the code actually HANDLING such events?



if(isPlayer(eAttacker) && (self != eAttacker) && (self.pers["team"] == eAttacker.pers["team"]))
{
if(level.friendlyfire == "0")
{
return;
}
else if(level.friendlyfire == "1")
{
// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

self finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime);

// Shellshock/Rumble
self thread maps\mp\gametypes\_shellshock::shellshockOnDamage( sMeansOfDeath, iDamage);
self playrumble("damage_heavy");
}

So just set level.friendlyfire to "1" right before you do that callback thingy...

Loveboy
30th December 2013, 10:37
So just set level.friendlyfire to "1" right before you do that callback thingy...

I had this idea too, I did already test it, but it doesn't worked, so I asked in forum.

Tally
30th December 2013, 10:55
I had this idea too, I did already test it, but it doesn't worked, so I asked in forum.

You must be doing something seriously wrong, because I got it working just using the code you posted in your first post. I suggest you post the WHOLE code, and not just a snippet, so we can see the CONTEXT in which it sits.