PDA

View Full Version : killstreak problem



t1ker
29th July 2018, 21:01
the problem is "self iprintlnbold("test");" message doesnt show up i mean everything with "self"

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

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);
}

filthy_freak_
29th July 2018, 23:28
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);

IzNoGoD
30th July 2018, 04:45
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.

t1ker
2nd August 2018, 10:47
problem solved it works perfecto :)