SA-MP Forums Archive
Help Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Please (/showthread.php?tid=320758)



Help Please - ColdRain - 24.02.2012

how i can create like if someone his color blue and other color is blue when they shot each other no one lose health like God Mod ??! Please Help!


Re: Help Please - Shadow_ - 24.02.2012

I think if you do; SetPlayerTeam(playerid, 0); < That will set there team to 0. I think that disables team-kill, but im not sure. Otherwise you could create a system using OnPlayerShootPlayer if there in the same team then reset there health to what it was before. if not then take the damage.


Re: Help Please - Nonameman - 24.02.2012

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) {
    if (GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
        new Float:damagedHealth;
        GetPlayerHealth(damagedid, damagedHealth);
        SetPlayerHealth(damagedid, damagedHealth + amount);
    }
    return 1;
}



Re: Help Please - T0pAz - 24.02.2012

Use GetPlayerColor.


Re: Help Please - brett7 - 24.02.2012

https://sampwiki.blast.hk/wiki/SetPlayerTeam

"Players on the same team can not kill each other unless they use a knife. "