how can i make it not able to kill team mates by headshoting them help please ! public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9 && GetPlayerTeam(issuerid) != GetPlayerTeam(playerid))
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
(hundred percents?)
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) // issuerid/ the one who uses the weapon isn't invalid.
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(issuerid)) // checking teams are not same
{
if(weaponid == 34 && bodypart == 9) // checking the weapon and body part
{
new str[90];
format(str, sizeof(str), "%s has headshotted %s", pName(issuerid), pName(playerid));
SendClientMessageToAll(0x5BC178FF, str);
SetPlayerHealth(playerid, 0.0); // We will always use float integer because health is in float!
}
}
}
return 1;
}
pName(playerid)
{
new nameZ[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, nameZ, sizeof(nameZ));
return nameZ;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) // issuerid/ the one who uses the weapon isn't invalid.
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(issuerid)) // checking teams are not same
{
if(weaponid == 34 && bodypart == 9) // checking the weapon and body part
{
SetPlayerHealth(playerid, 0.0); // We will always use float integer because health is in float!
}
}
}
return 1;
}
577) : error 025: function heading differs from prototype
|
Isn't that same ? I mean.. is there a difference between his code and yours ?
|
|
first things yes it's the same team -_-
when i put this // CODE HERE // i get this error Код:
577) : error 025: function heading differs from prototype |