Help Custom Killstreaks
#1
Hey,
ive got a Problem with my Mod. I wanna incluede custom Killstreaks. So here is the Function, which counts the Kills after Death:

PHP Code:
KillCounter() { self endon("disconnect"); self endon("death"); wait 0.1; self.StartKills = self.pers["kills"]; self.Killstreak = 0; self thread setKillsToZero(); for(;;) { if(self.Killstreak != self.pers["kills"] - self.StartKills) {self.Killstreak = self.pers["kills"] - self.StartKills;} wait 0.1; } } setKillsToZero() { self endon("disconnect"); for(;;) { self waittill("death"); self.StartKills = self.pers["kills"]; self.Killstreak = 0; } }

But this Function is very buggy. The game laggs and when someone dies the game will freeze for some secs...
Anybody can help? Undecided
Reply

#2
Code:
for(;;) { self waittill("death"); self.StartKills = self.pers["kills"]; self.Killstreak = 0; }

Inf. loop.. add wait .05;
[Image: MaEIQ.png]
Reply

#3
(03-23-2011, 19:29)Pozzuh Wrote:
Code:
for(;;) { self waittill("death"); self.StartKills = self.pers["kills"]; self.Killstreak = 0; }

Inf. loop.. add wait .05;

there is a selfwaittill. Thats enough.
Reply

#4
You're right. Wasn't paying attention. Sorry.

btw. Isn't there a variable for killstreak already?
[Image: MaEIQ.png]
Reply

#5
(03-23-2011, 19:45)Pozzuh Wrote: You're right. Wasn't paying attention. Sorry.

btw. Isn't there a variable for killstreak already?

no, that works correctly. only the lagg and freeze issue is ther prob.
Reply

#6
self.pers["cur_kill_streak"]

You can use that for your custom killstreaks.
[Image: MaEIQ.png]
Reply

#7
(03-23-2011, 20:13)Pozzuh Wrote: self.pers["cur_kill_streak"]

You can use that for your custom killstreaks.

And how does this work?^^
Reply

#8
Use my code,
PHP Code:
onplayerspawned() { self.killcount = self.kills; self.numberofstreaks = 0; self.usingstreak = 0; for(;;) { self waittill("spawned_player"); self setClientDvar("cg_weaponCycleDelay", 0); self thread streaks(); self maps\mp\gametypes\_class::setKillstreaks( "none", "none", "none" ); } } streaks() { self endon("death"); self.startscore = self.kills; self.killcount = 0; while(1) { if(self.killcount != self.kills - self.startscore){ self.killcount = self.kills - self.startscore; switch(self.killcount) { case 5: self KillstreakNotify(HARDPOINT TYPE, "Press [{+actionslot 4}] for blalblab"); break; //ETC } } wait 0.0000000000001; // OMFG ANTI BUG LIKE } } KillstreakNotify( streakName, txt) { self endon("disconnect"); self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Killstreak: "+self.killcount, txt, "", (0,0,1) ); self maps\mp\gametypes\_hardpoints::giveKillstreak( streakname , streakname, true ); self iprintln(self.name + " got killstreak with " + self.killcount + " kills!"); wait 1; }
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#9
(03-23-2011, 21:30)Se7en Wrote: Use my code,
PHP Code:
onplayerspawned() { self.killcount = self.kills; self.numberofstreaks = 0; self.usingstreak = 0; for(;;) { self waittill("spawned_player"); self setClientDvar("cg_weaponCycleDelay", 0); self thread streaks(); self maps\mp\gametypes\_class::setKillstreaks( "none", "none", "none" ); } } streaks() { self endon("death"); self.startscore = self.kills; self.killcount = 0; while(1) { if(self.killcount != self.kills - self.startscore){ self.killcount = self.kills - self.startscore; switch(self.killcount) { case 5: self KillstreakNotify(HARDPOINT TYPE, "Press [{+actionslot 4}] for blalblab"); break; //ETC } } wait 0.0000000000001; // OMFG ANTI BUG LIKE } } KillstreakNotify( streakName, txt) { self endon("disconnect"); self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Killstreak: "+self.killcount, txt, "", (0,0,1) ); self maps\mp\gametypes\_hardpoints::giveKillstreak( streakname , streakname, true ); self iprintln(self.name + " got killstreak with " + self.killcount + " kills!"); wait 1; }

thx Big Grin
i hope this isnt laggy than mine ^^

BTW: I like the OMFG ANTI BUG LIKE comment^^
Reply

#10
cool i was about to post a thread on this xD but now it here ill just ask,
i would like to have custom killstreaks mixed with one's a have made," ie
on 3 kill's give morterstrike and on 5 kill's give minigun that shot's rpg's,
i also seen this code
Code:
if(self.pers["cur_kill_streak"] == 25) { self maps\mp\gametypes\_hardpoints::giveKillstreak(""); }
could that help?
arrrg im just really confused on how to get this to work
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 18,201 10-29-2013, 07:22
Last Post: xInfinity.
  Custom xanims DidUknowiPwn 8 9,740 08-28-2013, 08:17
Last Post: RaZ
  Help Make ac130 shoot custom bullets Ra3shed 0 3,644 07-23-2013, 13:02
Last Post: Ra3shed
  [Tutorial] Custom gametype HUD iAegle 17 20,512 07-14-2013, 01:16
Last Post: Nekochan
Video Custom Facepaints? Cuddlyedits 5 6,876 07-01-2013, 14:58
Last Post: iPaddie
  Help dedicated servers and custom dvars mattyman 0 3,373 06-22-2013, 07:33
Last Post: mattyman
Big Grin Killstreaks HUD list Puffiamo 9 12,577 06-18-2013, 18:42
Last Post: RaZ
Information [Tutorial] Adding DLC Maps as Custom Maps. Nekochan 151 182,706 05-25-2013, 01:05
Last Post: Nero Z zero
  QS Mod by GeKKo v 6.5 with Custom Maps GeKKoFL0X 35 37,943 05-21-2013, 19:30
Last Post: [HARD] Tony.
  [Request] custom gun mod ColorCorrects 2 4,491 05-18-2013, 22:19
Last Post: mitchhacker

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.