PDA

View Full Version : Klllstreaks



Rocky
15th October 2013, 16:52
Hey,can somebody put here some killstreaks script?
Thanks!

Loveboy
15th October 2013, 18:02
Hello Rocky!

Please look up as first if there is already a thread about that.
If there are not a tutorial about that, ask the question.

Here the tutorial (Read comment from Jeplaa)
http://killtube.org/showthread.php?950-Killstreak&highlight=Killstreak

Rocky
16th October 2013, 12:45
erorr...i put like at post and dont work.

Ni3ls
16th October 2013, 13:11
post the error and your script. I tjhink your level of scripting is way too low. Better start with the basics. Because this is a waste of time

Rocky
16th October 2013, 13:27
i'm low :P

Jeplaa
16th October 2013, 14:56
It's your lucky day.

Here (http://speedy.sh/JNh6C/z-killstreak.iwd) you can download "improved" version of killstreak.


Explanation:

_killstreak.gsc file


AddStreak()
{
player = self;
killstreak = player.stats["killstreak"];
switch(killstreak)
{
case 3:
iPrintLn(player.name + " ^7is on 3 killstreak!");
break;
case 5:
iPrintLn(player.name + " ^7is on 5 killstreak!");
break;
}
}


Inside tdm.gsc file

in Callback_PlayerKilled(...) under or above attacker.score++


attacker.stats["killstreak"]++;
attacker thread maps\mp\gametypes\_killstreak::AddStreak();


in spawnPlayer()


self.stats = [];
self.stats["killstreak"] = 0;


Enjoy.

YuriJurek
16th October 2013, 21:22
Hello there, I've go just a simple question, not really related to killstreaks but it will fit in here, so why do people sometimes define something like

player = self; Before going on here

player = self;
killstreak = player.stats["killstreak"]; ?
Where they could just do
killstreak = self.stats["killstreak"];

I am a bit confused about it, can someone explain it for me please ?

And one last thing, would it be ok if I make a thread in which I could post some questions as I push forward in developing my scripting skills? I mean questions about things that are obvious but I would like to know exactly what I am doing.

malyczolg
16th October 2013, 21:55
you need help with ks ? i can help you
Xf : czolk

Tally
17th October 2013, 10:20
Hello there, I've go just a simple question, not really related to killstreaks but it will fit in here, so why do people sometimes define something like Before going on here ?
Where they could just do
killstreak = self.stats["killstreak"];

I am a bit confused about it, can someone explain it for me please ?

And one last thing, would it be ok if I make a thread in which I could post some questions as I push forward in developing my scripting skills? I mean questions about things that are obvious but I would like to know exactly what I am doing.

A lot of people do it. Even Infinity Ward developers. Here is the stock maps\mp\gametypes\_healthoverlay.gsc:


playerBreathingSound(healthcap)
{
self endon("end_healthregen");

wait (2);
player = self;
for (;;)
{
wait (0.2);
if (player.health <= 0)
return;

// Player still has a lot of health so no breathing sound
if (player.health >= healthcap)
continue;

player playLocalSound("breathing_hurt");
wait .784;
wait (0.1 + randomfloat (0.8));
}
}


I personally never do it, because, as you say, it just seems wrong somehow.

Ni3ls
17th October 2013, 10:41
And one last thing, would it be ok if I make a thread in which I could post some questions as I push forward in developing my scripting skills? I mean questions about things that are obvious but I would like to know exactly what I am doing.

Ofcourse thats ok

Jeplaa
17th October 2013, 12:56
Hello there, I've go just a simple question, not really related to killstreaks but it will fit in here, so why do people sometimes define something like Before going on here ?
Where they could just do
killstreak = self.stats["killstreak"];

I am a bit confused about it, can someone explain it for me please ?

And one last thing, would it be ok if I make a thread in which I could post some questions as I push forward in developing my scripting skills? I mean questions about things that are obvious but I would like to know exactly what I am doing.

I did it in almost every code just for the simplification. Of course it doesn't change anything :)

YuriJurek
17th October 2013, 15:14
Thanks for your answers guys, I was just a bit unsure if it makes any difference, so that's all I needed to know, thanks again ;)