SA-MP Forums Archive
Team reward rep + - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Team reward rep + (/showthread.php?tid=617516)



Team reward rep + - Mijata - 22.09.2016

How to make reward for team who get 50 kills in server and reset team kills after win?
Teams are defined C1 and T1


Re: Team reward rep + - ReshiramZekrom - 22.09.2016

You have to create a global variable like teams[2]; (or team1; and team2.
Then you have to check on OnPlayerDeath if the killerid is in one of the two teams and if yes teams[0] or teams[1] (depending on which is the team of the killerid) will be increased by one.
When teams[0] or teams[1] reach 50, you can reset it to 0 with teams[0] = 0; or teams[1] = 0.