16.11.2012, 20:08
Код:
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); }