19.08.2009, 10:48
Help me please
How to make team kill for PlayerSkin(105,106,107) and (102,103,104)
public OnPlayerSpawn(playerid)
if(gTeam[playerid] == TEAM_GROVE) {
SetPlayerSkin(playerid,105);
SetPlayerColor(playerid,COLOR_GREEN); // Green
}
else if(gTeam[playerid] == TEAM_GROVE1) {
SetPlayerSkin(playerid,106);
SetPlayerColor(playerid,COLOR_GREEN); // Green
}
else if(gTeam[playerid] == TEAM_GROVE2) {
SetPlayerSkin(playerid,107);
SetPlayerColor(playerid,COLOR_GREEN); // Green
}
else if(gTeam[playerid] == TEAM_BALLA) {
SetPlayerSkin(playerid,102);
SetPlayerColor(playerid,COLOR_BLUE); // Blue
}
else if(gTeam[playerid] == TEAM_BALLA1) {
SetPlayerSkin(playerid,103);
SetPlayerColor(playerid,COLOR_BLUE); // Blue
}
else if(gTeam[playerid] == TEAM_BALLA2) {
SetPlayerSkin(playerid,104);
SetPlayerColor(playerid,COLOR_BLUE); // Blue
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
}
else {
if(gTeam[killerid] != gTeam[playerid]) {
// Valid kill
SendDeathMessage(killerid,playerid,reason);
UAS_GivePlayerMoney(killerid,1000);
}
else
{
//Team Killer!
SendClientMessage(killerid, COLOR_YELLOW, "Не стреляй в своих!");
SendDeathMessage(killerid,playerid,reason);
SetPlayerHealth(killerid,0.0);
UAS_GivePlayerMoney(killerid,-2000);
}
}
return 1;
}