Results 1 to 4 of 4

Thread: killstreak problem

  1. #1
    ... connecting
    Join Date
    Feb 2017
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    killstreak problem

    the problem is "self iprintlnbold("test");" message doesnt show up i mean everything with "self"
    Code:
    Messages( sMeansOfDeath, attacker )
    {
    	if(sMeansOfDeath == "MOD_HEAD_SHOT")
    	{
    		distance = distance(Attacker.origin , self.origin); //Inches
    		meters = distance * 0.0254;		          //Meters
    		feet = distance / 12;			         //Feet
    
    		if(!isDefined("shm_metric") || getcvar("shm_metric") == "")
    		setcvar("shm_metric", "meters");
    
    		if(getCVar("shm_metric") != "feet")
    		{
    			iprintln("^7" + attacker.name + "^7 killed ^1" + self.name + "^7 with a headshot over a distance of ^1" + meters + " meters!"); 		
    		}
    
    		if(getCVar("shm_metric") == "feet")
    		{
    			iprintln("^7" + attacker.name + "^7 killed ^1" + self.name + "^7 with a headshot over a distance of ^1" + feet + " feet!"); 		
    		}
    	}
    		
    		
    		
    	if(!isDefined(attacker.pers["kill_spree"]))
    		attacker.pers["kill_spree"] = 0;
    	  
    	if( !isDefined( attacker.killstreakText ))
    		attacker thread CreateKillstreakHUD();
    
    	self.pers["kill_spree"] = 0;
    	attacker.pers["kill_spree"]++;
    
    	self.killcount = attacker.pers["kill_spree"];
    
    	attacker UpdateKillstreakHUD( attacker.pers["kill_spree"] );
    	
    	if(self.killcount == 3)
    		iprintln("^7" + attacker.name + "^7 is on 3 killstreak ^1");
    		self iprintlnbold("test");
    	
    	if(self.killcount == 5)
    		iprintln("^7" + attacker.name + "^7 is on 5 killstreak ^1");
    
    	if(self.killcount == 7)
    		iprintln("^7" + attacker.name + "^7 is on 7 killstreak ^1");
    
    		
    	if(self.killcount == 10)
    		 iprintln("^7" + attacker.name + "^7 is on 10 killstreak ^1");
    		
    
    	if(self.killcount == 20)
    		iprintln("^7" + attacker.name + "^7 is on 20 killstreak ^1");
    }
    Thread is on callback_playerkilled and gametype is ctf
    Code:
    		else
    		{
    			
    			attackerNum = attacker getEntityNumber();
    			doKillcam = true;
    
    			if(self.pers["team"] == attacker.pers["team"]) // killed by a friendly
    				attacker.score--;
    				
    			else
    				attacker.score++;
    			thread maps\mp\gametypes\_shmod::Messages( sMeansOfDeath, attacker);	
    		}

  2. #2
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Try "attacker iprintlnbold("test");" however this will only display the message for the person who killed the player.

    EDIT: also if you want self to work try changing

    thread maps\mp\gametypes\_shmod::Messages( sMeansOfDeath, attacker);
    to
    self thread maps\mp\gametypes\_shmod::Messages( sMeansOfDeath, attacker);
    Last edited by filthy_freak_; 30th July 2018 at 01:06.

  3. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    Polat (30th July 2018)

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Does your UpdateKillstreakHUD have a while/for loop in it with a wait (or waittill) nested inside? If so, try threading the call to that.

    Also, why are you storing the killing spree in a .pers variable? That persists over a fast_restart through script, which means a player would respawn with his old killingspree intact.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. The Following User Says Thank You to IzNoGoD For This Useful Post:

    t1ker (2nd August 2018)

  6. #4
    ... connecting
    Join Date
    Feb 2017
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    problem solved it works perfecto

Posting Permissions

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