Teammate getting back his HP
#1

Basically I check if a team A is shooting team A, if is, give back HP to victim player. However, if team B shoot team A victim and he loose lets say 60 hp, having 40 hp left, if a team A member shoots the other team A member now, he gets back his HP.. How do I solve this?

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(gTeam[issuerid] == TEAM_COP && gTeam[playerid] == TEAM_COP && weaponid >= 0 && weaponid <= 42)
    {
        new Float:hp;
        GetPlayerHealth(playerid, hp);
        SetPlayerHealth(playerid, hp + amount);
        GameTextForPlayer(issuerid, "~r~Dont attack teammates", 5000, 1);
    }
    else
    {
        format(pHitDamage, sizeof(pHitDamage), "-%.0f HP", amount);
        SetPlayerChatBubble(playerid, pHitDamage, 0x09D33FAA, 150.0,2500);
    }
    return 1;
}
Reply
#2

Why not just setting teams ?
Reply
#3

SetPlayerTeam?
Reply
#4

Now im stuck with this:
Criminal - Team 1
Cop - Team 2
Agent - Team 3
Army - Team 4

Cop cannot attack cop, but cop can attack agent and army.. agent can attack cop and so on going..
How to solve this?
Reply
#5

You should script the factions, and keep the teams.

as in, team 1 being 'good' and team 2 being 'bad'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)