Quote:
Originally Posted by Abagail
Well, you can check if the player is wanted, has been killed by the player recently, if they have done any [/me's](assuming it's a roleplay server), etc.
Example:
pawn Code:
stock IsDeathmatch(playerid, targetid) { if(RecentlyKilledBy[playerid] != targetid && GetPlayerWantedLevel(targetid) == 0 && // bla bla { return 1; } else return 0; }
Then you can do something like:
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) { if(playerid != issuerid && IsDeathmatch(issuerid, playerid)) { new Float: health; GetPlayerHealth(playerid, health+amount); SetPlayerHealth(playerid, health); CallLocalFunction("OnPlayerDeathmatch", "ddd", playerid, issuerid, weaponid); return 1; } return 1; }
|
Would something like this work?
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(playerid != issuerid && IsALawEnforcement(issuerid) || gTeam[playerid] == TEAM_CIV && GetPlayerWantedLevel(playerid) < 1 )
{
new Float: health;
GetPlayerHealth(playerid, health+amount);
SetPlayerHealth(playerid, health);
return 1;
}
return 1;
}
Are there any other examples?