ItsMods
[Tutorial] Custom Kill/Point Streak Function - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Tutorial] Custom Kill/Point Streak Function (/Thread-Tutorial-Custom-Kill-Point-Streak-Function.html)



Custom Kill/Point Streak Function - Tomsen1410 - 09-06-2011

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.

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 Fuck yea!

Now you can just add custom streaks for someone with giveCustomStreak()

I hope this is helpful and not too bad!




RE: Custom Kill/Point Streak Function - Xzite - 09-06-2011

gj bro


RE: Custom Kill/Point Streak Function - iAegle - 09-06-2011

Could be more organized, but still nice.


RE: Custom Kill/Point Streak Function - Tomsen1410 - 09-06-2011

damned. forgot something to say:
if you want to delete a streakreward, just use this

Code:
self.setPointStreak[streak] = undefined;

or create a ew fucntion for it.


RE: Custom Kill/Point Streak Function - rotceh_dnih - 09-06-2011

what happens in SnD on next round??


RE: Custom Kill/Point Streak Function - Tomsen1410 - 09-06-2011

(09-06-2011, 18:41)rotceh_dnih Wrote: what happens in SnD on next round??

y not?
when not
just add self.pers i think


RE: Custom Kill/Point Streak Function - JariZ - 09-07-2011

(09-06-2011, 18:50)Tomsen1410 Wrote: self endon("disconnet");

nice typo :Awesome:
edit: I like it, it's sad no-one has the balls to create a tutorial on how to create a killstreak the 3arc way, it's kinda like the medals and isn't that hard
I got school right now so can't create it right now, itsmods y u no do it for me?


RE: Custom Kill/Point Streak Function - Tomsen1410 - 09-07-2011

(09-07-2011, 15:41)jariz Wrote:
(09-06-2011, 18:50)Tomsen1410 Wrote: self endon("disconnet");

nice typo :Awesome:
edit: I like it, it's sad no-one has the balls to create a tutorial on how to create a killstreak the 3arc way, it's kinda like the medals and isn't that hard
I got school right now so can't create it right now, itsmods y u no do it for me?

damned : P


RE: Custom Kill/Point Streak Function - darshin145 - 12-01-2011

Hello, Nice mod.

I am Very new to this and i need MAJOR help lol im not to smart in this stuff.

I downloaded the file and opened it with note pad? Im not sure if i was supposed to do that but now im confused on how to do the rest Please help me Thanks

I also have teamviewer if you want to connect to me and help me that way

Thanks.. Smile



RE: Custom Kill/Point Streak Function - JariZ - 12-01-2011

(12-01-2011, 00:04)darshin145 Wrote: Hello, Nice mod.

I am Very new to this and i need MAJOR help lol im not to smart in this stuff.

I downloaded the file and opened it with note pad? Im not sure if i was supposed to do that but now im confused on how to do the rest Please help me Thanks

I also have teamviewer if you want to connect to me and help me that way

Thanks.. Smile

This is a tutorial on how to create your own killstreaks for modders with basic GSC skill,
Please check out this: http://www.itsmods.com/forum/Thread-Tutorial-Scripting-for-Dummies.html
And come back here when you actually understand this