09.06.2013, 12:29
Quote:
I don't see why you'd need either of those. Guest123 is partially correct with SetPlayerTeam, but OnPlayerUpdate is severe overkill. Setting the team once on spawn is enough.
|
I thought he asks to create a anti friendly fire system. (I Assumed he already got something like that what defines the players team)
I thought he needed something like this :
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][gTeam] == PlayerInfo[playerid][gTeam])
{
new Float:health, Float:newhealth;
health = GetPlayerHealth(playerid, health);
newhealth = health += amount;
SetPlayerHealth(playerid, newhealth);
}
}
}