public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)//This callback is called when a player gives damage to another player.
{
if (GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
GameTextForPlayer(playerid, "~w~Hey~>~~r~STOP KILL", 2000, 3);
}
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
new Float:pHealth;
GetPlayerHealth(damagedid, pHealth);
if(damagedid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(damagedid))
return SetPlayerHealth(damagedid, pHealth);
}
return 1;
}
|
I want Multi Anti team kill between 3 teams not 3 players. -_- i want to set Anit team killing between USA UK and Russia Teams. and SetPlayerTeam i never use because i dont have time to rebuild an all parts of Team System. Who have here somthing usefull ?
|
|
No give damage
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
new Float:pHealth;
GetPlayerHealth(damagedid, pHealth);
if(damagedid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(damagedid))
return SetPlayerHealth(damagedid, pHealth);
}
return 1;
}
|
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype==BULLET_HIT_TYPE_PLAYER) //hit a player
if(GetPlayerTeam(playerid)==GetPlayerTeam(hitid)) //the same team
return 0; // block the shot
return 1;
}