Post: [CODE] Random Killstreaks!
02-05-2011, 02:44 AM #1
Blackstorm
Veni. Vidi. Vici.
(adsbygoogle = window.adsbygoogle || []).push({}); Here's a random killstreak code that I just made a while ago, Mossy you should add this to your optimized code thread Winky Winky

Just a simple code, gives you a random killstreak Smile

    
RandomStreak()
{
streaks = "uav/airdrop/counter_uav/sentry/predator_missile/harrier_airstrike/airdrop_mega/helicopter_flares/stealth_airstrike/helicopter_minigun/ac130/emp/nuke";
random = strTok(streaks,"/");
RS = random[randomint(random.size)];
self maps\mp\killstreaks\_killstreaks::giveKillstreak(RS,0);
self maps\mp\gametypes\_hud_message::killstreakSplashNotify(RS,1337);
}


Just call it in from your menu Winky Winky

Credits:

d7w7z for the idea and original code
x_DaftVader_x for the funny splashNotify code :carling:
EliteMossy for giving me a small tutorial on that strTok (String To Array) function. Smile

Enjoy Happy
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to Blackstorm for this useful post:

ainajp, Alfa, Chrome Playa, d7w7z, Mw2Freak13, Strike Venom, x_DaftVader_x
02-05-2011, 02:47 AM #2
pcfreak30
>> PCFreak30.com Happy<<
Wow, funny how I PM'ed this to you..
02-05-2011, 02:48 AM #3
Originally posted by MecAj View Post
Here's a random killstreak code that I just made a while ago, Mossy you should add this to your optimized code thread Winky Winky

    
RandomStreak()
{
streaks = "uav/airdrop/counter_uav/sentry/predator_missile/harrier_airstrike/airdrop_mega/helicopter_flares/stealth_airstrike/helicopter_minigun/ac130/emp/nuke";
random = strTok(streaks,"/");
RS = random[randomint(random.size)];
self maps\mp\killstreaks\_killstreaks::giveKillstreak(RS,0);
self maps\mp\gametypes\_hud_message::killstreakSplashNotify(RS,1337);
}


Just call it in from your menu Winky Winky

Credits:

d7w7z for the idea and original code
EliteMossy for giving me a small tutorial on that strTok (String To Array) function. Smile

Enjoy Happy


Or you could use my random killstreak box Smile

You must login or register to view this content.

The following user thanked x_DaftVader_x for this useful post:

Blackstorm
02-05-2011, 02:49 AM #4
Blackstorm
Veni. Vidi. Vici.
Originally posted by pcfreak30 View Post
Wow, funny how I PM'ed this to you..


okay first you only pm'd me like a quarter of the code, second, this code looks nothing like yours. I told you in PM i had made this code already.

---------- Post added at 07:49 PM ---------- Previous post was at 07:49 PM ----------

Originally posted by x View Post
Or you could use my random killstreak box Smile

You must login or register to view this content.


I like your killstreak box, but i had actually made this for my player menu in the give player option, give random killstreak Smile
02-05-2011, 02:51 AM #5
Originally posted by MecAj View Post
okay first you only pm'd me like a quarter of the code, second, this code looks nothing like yours. I told you in PM i had made this code already.

---------- Post added at 07:49 PM ---------- Previous post was at 07:49 PM ----------



I like your killstreak box, but i had actually made this for my player menu in the give player option, give random killstreak Smile


Is that where you got the 1337 killstreak idea from ? Winky Winky
02-05-2011, 02:52 AM #6
Blackstorm
Veni. Vidi. Vici.
Originally posted by x View Post
Is that where you got the 1337 killstreak idea from ? Winky Winky


Yes that's hilarious >: D

The following user thanked Blackstorm for this useful post:

x_DaftVader_x
02-05-2011, 02:54 AM #7
Originally posted by MecAj View Post
Yes that's hilarious >: D


No one ever commented on that in my killstreak box code... it was my favourite bit Smile

The following user thanked x_DaftVader_x for this useful post:

richiebanker
02-05-2011, 02:59 AM #8
Blackstorm
Veni. Vidi. Vici.
Originally posted by x View Post
No one ever commented on that in my killstreak box code... it was my favourite bit Smile


lol Yeah that's pretty funny =D and Nobody commented on that? :wtf: That's like the most noticable part lol

---------- Post added at 07:59 PM ---------- Previous post was at 07:57 PM ----------

Originally posted by pcfreak30 View Post
Wow, funny how I PM'ed this to you..


Also here's the only thing you gave me...

    
I will give you this:

streaks = strTok("killstreaks here with a ;",";");

foreach(streak in killstreaks)
{
self givekillStreak(streak); //Assuming that is the function
}


That's all, and it looks nothing like mine.
02-05-2011, 03:01 AM #9
pcfreak30
>> PCFreak30.com Happy<<
More of a concept. I wrote it in like 30 seconds but its still the same concept and method...
02-05-2011, 03:06 AM #10
Blackstorm
Veni. Vidi. Vici.
Originally posted by pcfreak30 View Post
More of a concept. I wrote it in like 30 seconds but its still the same concept and method...


Actually I based it off of d7w7z's concept...

    
RandomKillstreak()
{
C=[];
C[0]="uav";
C[1]="airdrop";
C[2]="counter_uav";
C[3]="sentry";
C[4]="predator_missile";
C[5]="harrier_airstrike";
C[6]="airdrop_mega";
C[7]="helicopter_flares";
C[8]="stealth_airstrike";
C[9]="helicopter_minigun";
C[10]="ac130";
C[11]="emp";
ks=C[randomint(C.size)];
self maps\mp\killstreaks\_killstreaks::giveKillstreak(ks,false);
self maps\mp\gametypes\_hud_message::killstreakSplashNotify(ks,1337);
}


Credits to him for that code, I based it off of this concept as well

Originally posted by TheEliteMossy

strtok is a C++ command, google it for a lot more help but it basically converts a string to an array

string = "THIS ITEM;THAT ITEM;MORE ITEM;ANOTHER ITEM";

we seperate each time with a ; so then we do

array = strTok(string,";");

now array contains 4 strings

array[0]=THIS ITEM
array[1]=THAT ITEM
array[2]=MORE ITEM
array[3]=ANOTHER ITEM

Understand? :P


So you didn't really help me in any way sorry.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo