17.12.2011, 20:50
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if ( playerid != INVALID_PLAYER_ID )
{
if ( gTeam[damagedid] == gTeam[playerid] ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_INDIA && gTeam[playerid] == TEAM_INDPM ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_INDPM && gTeam[playerid] == TEAM_INDIA ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_USA && gTeam[playerid] == TEAM_USPM ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_USPM && gTeam[playerid] == TEAM_USA ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_RUSSIA && gTeam[playerid] == TEAM_RUSPM ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_RUSPM && gTeam[playerid] == TEAM_RUSSIA ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_PAK && gTeam[playerid] == TEAM_PAKPM ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_PAKPM && gTeam[playerid] == TEAM_PAK ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_UK && gTeam[playerid] == TEAM_UKPM ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
if ( gTeam[damagedid] == TEAM_UKPM && gTeam[playerid] == TEAM_UK ) // check if the victim is from the same team as the playerid.
{
new Float:hp;
new Float:ap;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp + amount);
GetPlayerArmour(damagedid, ap);
SetPlayerArmour(damagedid, ap + amount);
SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
}
}
return 1;
}