09-06-2011, 18:00
(This post was last modified: 09-07-2011, 16:37 by Tomsen1410.)
I want to show u, how to create a fully custom Kill or Point Streak Function, with fully custom Streaks, which will be saved and can be started even if u were killed. So...like the real ones.
You have to decide, if you want to write in your .gsc File or you want to create a new one just for the Functions.
1. If you have decided to write it in an existing .gsc skip this step!
At first download this clean .gsc File >>CLICK<<
2. Define in your .gsc a new Variable. This is going to be your current streak. Lets call it self.TestStreak. And you need a variable, that tells you how much streakrewards you got already. Define it on onPlayerConnect.
3. Now you have to define, where you want self.TestStreak to increase. For example if you just want normal Kilstreaks, just write self.TestStreak+=1; on OnPlayerKilled(). If you want Pointstreaks (like MW3 :O) just write that whereever you want. For example for game objectives or whatever.
4. Next we have to create a function, which gives you a specific Kill- PointStreak:
This Function defines an array variable with the number of the needed streaks and the name, which streakreward you get.
5. Now you need to create a function, which checks if your current Streak (so the self.TestStreak variable) is defined:
So this function checks if a streakreward is defined at your current streak.
If it is true, it starts a function, at which we will look now.
You just have to put this check function next to your self.TestStreak increase.
6. At next we have to create a function, that gives you the killstreak you earn:
As you can see, it defines a new array variable with the number of the current streakrewards you have with the entity of the streakrewardname.
7. At last we need a function to play those custom streakrewards (orly?) Place this on OnPlayerConnect()
Well...here we define the Button which you have to press to start the Streakreward. AND you have to define, which customstreak should start when the streakname is however. Yess, now its your turn to create custom Streaks and be awesome
Now you can just add custom streaks for someone with giveCustomStreak()
I hope this is helpful and not too bad!
You have to decide, if you want to write in your .gsc File or you want to create a new one just for the Functions.
1. If you have decided to write it in an existing .gsc skip this step!
At first download this clean .gsc File >>CLICK<<
2. Define in your .gsc a new Variable. This is going to be your current streak. Lets call it self.TestStreak. And you need a variable, that tells you how much streakrewards you got already. Define it on onPlayerConnect.
Code:
onPlayerConnect()
{
for( ; ; )
{
level waittill( "connected", player );
player.TestStreak = 0;
player.hasCurrentStreak = 0;
player thread onPlayerSpawned();
}
}3. Now you have to define, where you want self.TestStreak to increase. For example if you just want normal Kilstreaks, just write self.TestStreak+=1; on OnPlayerKilled(). If you want Pointstreaks (like MW3 :O) just write that whereever you want. For example for game objectives or whatever.
4. Next we have to create a function, which gives you a specific Kill- PointStreak:
Code:
giveCustomStreak(streakname,streak)
{
self.setPointStreak[streak] = streakname;
}This Function defines an array variable with the number of the needed streaks and the name, which streakreward you get.
5. Now you need to create a function, which checks if your current Streak (so the self.TestStreak variable) is defined:
Code:
checkCustomStreak()
{
num = self.TestStreak;
if(isDefined(self.setPointStreak[num]))
self threadgetCustomStreak(self.setPointStreak[num]);
}So this function checks if a streakreward is defined at your current streak.
If it is true, it starts a function, at which we will look now.
You just have to put this check function next to your self.TestStreak increase.
6. At next we have to create a function, that gives you the killstreak you earn:
Code:
getCustomStreak(streakname)
{
self.hasCurrentStreaks+=1;
self.hasStreak[self.hasCurrentStreaks] = streakname;
}As you can see, it defines a new array variable with the number of the current streakrewards you have with the entity of the streakrewardname.
7. At last we need a function to play those custom streakrewards (orly?) Place this on OnPlayerConnect()
Code:
playPS()
{
self endon("disconnect");
for( ; ; )
{
if(self UseButtonPressed()) //is wayne what button you want
{
num = self.hasCurrentStreaks;
streak = self.hasStreak[num];
if(num != 0 && isDefined(num) && isDefined(streak))
{
if(streak == "<some shitty name1>")
{self thread shitty();}
else if(streak == "<some shitty name2>")
{self thread shitty2;}
self.hasCurrentStreaks-=1;
self.hasStreak[num] = undefined;
wait 2;
}
num = undefined;
streak = undefined;
}
wait 0.01;
}
}Well...here we define the Button which you have to press to start the Streakreward. AND you have to define, which customstreak should start when the streakname is however. Yess, now its your turn to create custom Streaks and be awesome

Now you can just add custom streaks for someone with giveCustomStreak()
I hope this is helpful and not too bad!



![[Image: tagssmall.png]](http://i1212.photobucket.com/albums/cc459/rotceh_dnih/tagssmall.png)