Results 1 to 6 of 6

Thread: Kill the mates too

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Kill the mates too

    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:

    Code:
    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?

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    PHP Code:
    players getentarray("player","classname");
    for(
    0players.sizei++);
    {
         
    players[isuicide();


  3. #3
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    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).

  4. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    sooooo
    did you EVER EVER look at the code actually HANDLING such events?

    Code:
    		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...

  5. #5
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    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.

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •