Deathmatch help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Deathmatch help (
/showthread.php?tid=156480)
Deathmatch help -
reallifescript - 22.06.2010
Hey I need help with something
Want to make a Team deathmatch with 2 teams (defined etc, works okay)
but when Team_RED kills a team_blue, i want that they get a score point or something
and when the total score is about 30, the game restarts
If you don't get it, might get it with this:
Player 1 (red) kills player 2 (blue)
Player 1 (red) teamscore +1
Player 2 (blue) teamscores stay the same
And when the score limit (defined in max_score or something) is reached, gmx is executed and it starts all over
Re: Deathmatch help -
reallifescript - 23.06.2010
Anybody?
Re: Deathmatch help -
(SF)Noobanatior - 23.06.2010
do you use gteam?
Re: Deathmatch help -
reallifescript - 23.06.2010
Yeah,
gTeam[playerid] = TEAM_RED;
gTeam[playerid] = TEAM_BLUE;
Re: Deathmatch help -
(SF)Noobanatior - 23.06.2010
Код:
#define ROUNDWON 30
enum dmteams {
Red,
Blue,
}
new DMScore[dmteams];
public OnPlayerDeath(playerid, killerid, reason){
if(gTeam[killerid] == TEAM_RED)DMScore[Red]++;
if(gTeam[killerid] == TEAM_BLUE)DMScore[BLUE]++;
if(DMScore[Red] == ROUNDWON)SendClientMessageToAll(0xffffff,"Red has won the match);
if(DMScore[Blue] == ROUNDWON)SendClientMessageToAll(0xffffff,"Blue has won the match);
return 1;
}
how about this