if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && weaponid == 23 && BODY_PART_HEAD == 9)
{
if (gTeam[playerid] == gTeam[issuerid])
{
SetPlayerHealth(playerid, -0);
SendClientMessage(issuerid, -1, "You can't headshot your teammates");
}
else
{
SetPlayerHealth(playerid, -100);
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && weaponid == 23 && bodypart == 9)
{
if(gTeam[playerid] == gTeam[issuerid])
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, -1, "You can't headshot your teammates");
}
else
{
SetPlayerHealth(playerid, 0);
|
Try this
PHP код:
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && weaponid == 23 && BODY_PART_HEAD == 9)
{
if (gTeam[playerid] == gTeam[issuerid])
{
SetPlayerHealth(playerid, -0);
SendClientMessage(issuerid, -1, "You can't headshot your teammates");
}
else
{
SetPlayerHealth(playerid, -100);
}
}
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(weaponid == 34 || weaponid == 23)
{
if(bodypart == 9)
{
if(gTeam[playerid] == gTeam[issuerid])
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, -1, "You can't headshot your teammates");
}
else
{
SetPlayerHealth(playerid, 0);
}
}
}
}
return 1;
}