Forum

> > CS2D > Scripts > Kill team scores
Forums overviewCS2D overview Scripts overviewLog in to reply

English Kill team scores

4 replies
To the start Previous 1 Next To the start

old Kill team scores

maninja
User Off Offline

Quote
Hello Guys hope all Fine

I need someone help me , anyway if you kill someone in Your team you get in scores -1 But I'm I not want it I want if You kill someone in your team You will get in scores 1 please guys help me. I need it so much

old Re: Kill team scores

DC
Admin Off Offline

Quote
Use the cs2d lua hook kill hook to detect the kill.
Use cs2d lua cmd player to get the score of the player.
Use cs2d cmd setscore to set a new score.

I'm not sure right now if the Lua script in the kill hook is executed before or after modifying the score. In any case: If you detect that it is a teamkill (use cs2d lua cmd player team to compare teams) you should add +2 to the score because
score -1 +2 = score +1
.

Attention: All this might lead issues with the rank stats system stuff. Not sure about that though.

old Re: Kill team scores

maninja
User Off Offline

Quote
@user DC: But I do not know how to do it because I'm new in this area. I came here to help me. Can you collect that in one Lua ? I mean full Lua

old ?

jerezinho
User Off Offline

Quote
1
2
3
4
5
6
addhook("kill","_killer")
function _killer(killer,victim)
if player(killer,"team")==1 and player(victim,"team")==1 or player(killer,"team")==2 and player(victim,"team")==2 then
     parse("setscore " .. killer .. " " .. player(killer,"score")+2)
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview