18.12.2011, 10:29
So you're adding score to the team of the person that just died?
EDIT:
EDIT:
pawn Код:
#include <a_samp>
new TEAM_1_SCORE = 0, TEAM_2_SCORE = 0;
new gTeam[MAX_PLAYERS];
#define TEAM_1 0
#define TEAM_2 1
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
switch(gTeam[playerid])
{
case TEAM_1: TEAM_1_SCORE++;
case TEAM_2: TEAM_2_SCORE++;
default: return 1;
}
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/teamscore",true) == 0)
{
new msg[128];
switch(gTeam[playerid])
{
case TEAM_1: format(msg,128,"Your Team Score: %i",TEAM_1_SCORE);
case TEAM_2: format(msg,128,"Your Team Score: %i",TEAM_2_SCORE);
default: return 1;
}
SendClientMessage(playerid,0xFF0000FF,msg);
return 1;
}
return 0;
}

