Team score?
#1

How would i do team score, then the server restarts (newround) when the team gets 50 Score?
Reply
#2

This should give you an idea (I hope) on how to do it.

pawn Код:
new TeamScore;

//Use this to add to the team's score - "TeamScore += 1;"

if(TeamScore >= 50) //If team's score is 50 or greater
{
    SendRconCommand("gmx"); //restart the server
    return 1;
}
Reply
#3

use an array for multiple teams,
a timer that runs around like every two or three seconds, to reduce server load
and a function called by that timer.
if you want to go by kill you would put in an if else if structure, or a switch int he onplayer death that checks the killers team and adds the point to their team.
Reply
#4

[HELP] I NEED A TEAM SYSTEM I CANT MAKE IT BECAUSE I DONT KNOW HOW
FOR QUESTIONS ON mitsos-1997-221@hotmail.com
please help
Reply
#5

....edit for your needs is not very good because i don't know your code so.. i have do my best...

pawn Код:
#include <a_samp>

#define TEAM_BLUE                                                               0
#define TEAM_RED                                                                1

new TeamBlueScore;
new TeamReadScore;
new CheckScoreTimer;

forward ScoreCheck();

public OnFilterScriptInit()
{
TeamBlueScore = 0;
TeamReadScore = 0;
CheckScoreTimer = SetTimer("ScoreCheck", 1000 * 5, 1);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerTeam(killerid) == TEAM_BLUE)
{
TeamBlueScore ++;
}
if(GetPlayerTeam(killerid) == TEAM_RED)
{
TeamReadScore ++;
}
return 1;
}

public ScoreCheck()
{
if(TeamBlueScore > 25)
{
GameTextForAll("~w~Team ~b~Blue ~w~Wins", 2500, 4);
return 1;
}
else if(TeamReadScore > 25)
{
GameTextForAll("~w~Team ~r~Read ~w~Wins", 2500, 4);
return 1;
}
SendRconCommand("gmx");
KillTimer(CheckScoreTimer);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)