Make Costume KillStreaks

Posts 1–15 of 15 · Page 1 of 1
Make Custom KillStreaks
NB: I didn't make the code ( Credits below )

Code here:

Code:
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

doKillstreaks()  
{
	self endon ("death");
 
	self.startscore = self.pers["kills"];
	
    while(1) {
        if(self.killcount != self.pers["kills"] - self.startscore) {
            self.killcount = self.pers["kills"] - self.startscore;
            switch(self.killcount) 
			{
			case 1: 
				self notify("newstreak");
//You add the action here...
				break;
			case 2: 
				self notify("newstreak");
//You add the action here...
				break;
            }
		}
        wait 0.05;
	}
}
Make an new GSC file in folder with the _rank.gsc , call the new named file:
_mykillstreaks.gsc
In the doDvars or OnPlayerSpawned
Add this:
self thread maps\mp\gametypes\_mykillstreaks::doKillstreaks();
This makes the main file get "info" from another file.

So this is it, hope its helpful.

Credits:
H4RDC0R3
Rowan
Me for Show you
thx alot dude i'm gonna use it for my ai zombie mod
Does that code need to be in _mykillstreaks.gsc or in _rank.gsc ?
Quote Originally Posted by lolkop123 View Post
Does that code need to be in _mykillstreaks.gsc or in _rank.gsc ?
Well, Its the best. But if you want to but it in. Sure, just add it as an normal thread and not the other things....
*Fixed the Type falt.
EDIT: I faild.....
a question how can i adjust it so when i kill 5 ppl i get my 1st killstreak and when i kill 7 i get second this is just an example hope you understand what i mean
Quote Originally Posted by .:MUS1CFR34K:. View Post
a question how can i adjust it so when i kill 5 ppl i get my 1st killstreak and when i kill 7 i get second this is just an example hope you understand what i mean
Code:
doKillstreaks()  
{
	self endon ("death");
 
	self.startscore = self.pers["kills"];
	
    while(1) {
        if(self.killcount != self.pers["kills"] - self.startscore) {
            self.killcount = self.pers["kills"] - self.startscore;
            switch(self.killcount) 
			{
			case 1: // The case means what the killstreak have to be, in this case, it is 1
				self notify("newstreak");
//You add the action here...
				break;
			case 2: 
				self notify("newstreak");
//You add the action here...
				break;
			case 7: // Need 7 KS..
				self notify("newstreak");
//You add the action here...
				break;
            }
		}
        wait 0.05;
	}
}
ok i got the killstreak done its ranger unlimited ammo super speed and 500 health

killstreak works but wont end until i die any suggestions?
You can do like this:
doKillstreaks()
{
self endon ("death");

self.startscore = self.pers["kills"];

while(1) {
if(self.killcount != self.pers["kills"] - self.startscore) {
self.killcount = self.pers["kills"] - self.startscore;
switch(self.killcount)
{
case 1:
self notify("newstreak");
self thread KS1();
break;
case 2:
self notify("newstreak");
self thread KS2();
break;
}
}
wait 0.05;
}
}
And make threads like:

KS1()
{
self thread maps\mp\gametypes\_hud_message::hintMessage("^7 1 killstreak press 6 for rage");
self giveweapon("ak47_mp", 1, false);
}

( And it will be no need to press to get, give auto when you got 1 killstreak. )

Or as you asked:
doKillstreaks()
{
self endon ("death");

self.startscore = self.pers["kills"];

while(1) {
if(self.killcount != self.pers["kills"] - self.startscore) {
self.killcount = self.pers["kills"] - self.startscore;
switch(self.killcount)
{
case 1:
self notify("newstreak");
self thread maps\mp\gametypes\_hud_message::hintMessage("^7 1 killstreak press 6 for rage");
break;
case 2:
self notify("newstreak");
self thread maps\mp\gametypes\_hud_message::hintMessage("^7 2 killstreak press 6 for rage");
break;
}
}
wait 0.05;
}
}
Quote Originally Posted by Jorndel View Post
And make threads like:




( And it will be no need to press to get, give auto when you got 1 killstreak. )

Or as you asked:
i got that figured out by my own but now i got a new problem my killstreak works but wont end untill i die
btw i made it like this at the end
wait 30;
self notify (text thing blablablba <=== just an example
break

my guess is that i need to add another wait after text stuff am i correct?
Quote Originally Posted by .:MUS1CFR34K:. View Post
i got that figured out by my own but now i got a new problem my killstreak works but wont end untill i die
btw i made it like this at the end
wait 30;
self notify (text thing blablablba <=== just an example
break

my guess is that i need to add another wait after text stuff am i correct?
What you mean?

You mane:

That your text keep spaming?
Or ?

Cuse it will Break: = Pause the thread / function ( Like here, it will pause until the player get the next killstreak, or die )
Quote Originally Posted by Jorndel View Post
What you mean?

You mane:

That your text keep spaming?
Or ?

Cuse it will Break: = Pause the thread / function ( Like here, it will pause until the player get the next killstreak, or die )
ok here is what i've done i made it so its only 1 killstreak at 0kills
i did that just for testing
my problem is that killstreak doesnt end untill i die
so you say i gotta make more killstreaks?
btw i have the break code at the end
Quote Originally Posted by .:MUS1CFR34K:. View Post
ok here is what i've done i made it so its only 1 killstreak at 0kills
i did that just for testing
my problem is that killstreak doesnt end untill i die
so you say i gotta make more killstreaks?
btw i have the break code at the end
Look at the tutorial. Maybe helpful...

>>LINK HERE<<

Or like this: ( It is from my mod, just so you know )
Code:
#include maps\mp\_utility;


KSall()  
{
	self endon ("death");
 
	self.startscore = self.pers["kills"];
	
    while(1) {
        if(self.killcount != self.pers["kills"] - self.startscore) {
            self.killcount = self.pers["kills"] - self.startscore;
            switch(self.killcount) 
			{
			case 3: 
				self notify("newstreak");
				self thread do1();
				break;
			case 5: 
				self notify("newstreak");
				self thread do2();
				break;
			case 7:
				self notify("newstreak");
				self thread do3();
				break;
			case 9:
				self notify("newstreak");
				self thread do4();
				break;
            }
		}
        wait 0.05;
	}
}

do1()
{
self iPrintlnBold( "^5New ^2Weapon ^5found!" );
self giveweapon("barrett_fmj_thermal_mp", 4, false);
self switchtoweapon( "barrett_fmj_thermal_mp", 4, true );
}

do2()
{
self iPrintlnBold( "^5New ^2Weapon ^5found!" );
self giveweapon("p90_rof_xmags_mp", 5, false );
self switchtoweapon( "p90_rof_xmags_mp", 5, true );
}

do3()
{
self iPrintlnBold( "^5New ^2Weapon ^5found!" );
self giveweapon("aug_eotech_grip_mp", 6, false );
self switchtoweapon( "aug_eotech_grip_mp", 6, true );
}

do4()
{
self iPrintlnBold( "^5New ^2Weapon ^5found!" );
self giveweapon("rpd_heartbeat_thermal_mp", 7, true );
self switchtoweapon( "rpd_heartbeat_thermal_mp", 7, true );
}
Hope It helps, and yes. there is text there. ( If you didn't see I mean )
I used this in Chaotic Invasion, the code for this is in killstreaks.gsc,so I extracted this from there:

Code:
do5Streak()
{
              Killstreak5 = spawnstruct();      
              Killstreak5.iconName = "cardicon_abrams";
	Killstreak5.titleText = "5 KILL STREAK!";
              Killstreak5.notifyText = "Press ^3[{+actionslot 4}] ^7for ARTILLERY.";
	Killstreak5.sound = "killstreak_earned";
	Killstreak5.glowColor = (0.3, 0.8, 0.3);
              self thread maps\mp\gametypes\_hud_message::notifyMessage( Killstreak5 );
	self thread giveArtillery();
}
This gives you the killstreak as a pavelow, nuke or harrier,with sound and same message style, just change numbers, message and stuff like the thread I putted there.
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?