team score
#1

hello,
I got a question.
how do you script a teams score and when a team has like 50 kills (1 kill, 1 score) that team wins
diddent find anything in the wiki. If you got a wiki page for me plz post. I wanted to make it myself but i cant cuz i dont have any info.
thanks in advantage
Reply
#2

new scoreteam;

scoreteam++;
Reply
#3

Quote:
Originally Posted by Rks_
new scoreteam;

scoreteam++;
and work with a counter then??
Reply
#4

can you guys plz give some more info
Thanks in advantage
Reply
#5

new killlerteam[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
killlerteam[killerid]+=1;
}

SetTimer("checkscore", 1000, 1);

public checkscore()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(killlerteam [ i ]>=50)
{
winthendosomething();
return 1;
}
}
}

public winthendosomething()
{
dosomething;
}
Reply
#6

I believe that won't work...

Try making an enum, then create a variable with the enum, and use that to set the score..
Ex:
http://pastebin.ca/1256992
Reply
#7

Код:
F:\San andreas server stuff\Mini Missions\MBDM.pwn(34) : error 009: invalid array size (negative, zero or out of bounds)
F:\San andreas server stuff\Mini Missions\MBDM.pwn(224) : warning 213: tag mismatch
F:\San andreas server stuff\Mini Missions\MBDM.pwn(225) : warning 213: tag mismatch
F:\San andreas server stuff\Mini Missions\MBDM.pwn(233) : warning 213: tag mismatch
F:\San andreas server stuff\Mini Missions\MBDM.pwn(234) : warning 213: tag mismatch
F:\San andreas server stuff\Mini Missions\MBDM.pwn(242) : warning 213: tag mismatch
F:\San andreas server stuff\Mini Missions\MBDM.pwn(243) : warning 213: tag mismatch
The first error comes from this line
pawn Код:
new teamScore[pTeams];
I get tag mismatch for the variable
pawn Код:
teamScore
Reply
#8

Show me how you put it in your script...
Reply
#9

Heres the onplayerdeath where the mismatches come from
pawn Код:
//OnPlayerDeath
if(gTeam[playerid] == TEAM_COR)
    {
    teamScore[TEAM_COR]++;
    if(teamScore[TEAM_COR] >= 50)
    {
        GameTextForAll("~w~Corleones Won",5000,3);
        SetTimer("EndGM", 10000,0);
    }
    }
else if(gTeam[playerid] == TEAM_TAT)
    {
    teamScore[TEAM_TAT]++;
    if(teamScore[TEAM_TAT] >= 50)
    {
        GameTextForAll("~y~Tattaglias Won",5000,3);
        SetTimer("EndGM", 10000,0);
    }
    }
else if(gTeam[playerid] == TEAM_CUN)
    {
    teamScore[TEAM_CUN]++;
    if(teamScore[TEAM_CUN] >= 50)
    {
        GameTextForAll("~b~Cuneos Won",5000,3);
        SetTimer("EndGM", 10000,0);
    }
    }
}
And this at my other defines and new's and stuff
pawn Код:
new teamScore[pTeams];
Did I do something wrong?
Reply
#10

I hope you put the enum with TEAM_COR, TEAM_TAT and TEAM_CUN over main()
pawn Код:
enum pTeams
{
    TEAM_COR,
    TEAM_TAT,
    TEAM_CUN
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)