Score system - HELP
#3

Код:
new team1score=0; // declaring team 1 score
new team2score=0; //declaring team 2 score
new team[MAX_PLAYERS]; //will use to find out team of player
Код:
public OnPlayerRequestClass(playerid,classid)
{
   if(classid(playerid)==0)
   {
        team[playerid]=0; //setting team of player
   }
   if(classid(playerid)==1)
   {
        team[playerid]=1; //setting team of player
   }
}
Код:
OnPlayerDeath(playerid,killerid,reason)
{
     if(team[killerid]==0)
     {
          team1score++; //adding kill to team which killed player
    }
    if(team[playerid]==1)
    {
          team2score++; //adding kill to team which killed player
    }
    if(team[playerid]==0)
    {
          team1score++;
    }
}
Код:
CMD:score(playerid,params[]) //displaying kills
{
       new string[100];
       format(string,sizeof(string),"Team1:%i,Team2:%i",team1score,team2score);
       SendClientMessage(playerid,COLOR_BLUE,string);
}
Untested. Hope it works
Reply


Messages In This Thread
Score system - HELP - by Saddin - 16.11.2012, 19:20
AW: Score system - HELP - by Skimmer - 16.11.2012, 19:52
Re: Score system - HELP - by Sam5513 - 16.11.2012, 20:08
Re: Score system - HELP - by Saddin - 16.11.2012, 20:10
Re: Score system - HELP - by Sam5513 - 16.11.2012, 20:12
Re: Score system - HELP - by Saddin - 16.11.2012, 20:15
Re: Score system - HELP - by Sam5513 - 16.11.2012, 20:24
Re: Score system - HELP - by Saddin - 16.11.2012, 20:43
Re: Score system - HELP - by Sam5513 - 17.11.2012, 08:13
Re: Score system - HELP - by Saddin - 17.11.2012, 08:41
Re: Score system - HELP - by Konstantinos - 17.11.2012, 08:45
Re: Score system - HELP - by Sam5513 - 17.11.2012, 09:46

Forum Jump:


Users browsing this thread: 2 Guest(s)