If player shoots same team, he gets a textdraw warning (which callback do i use)
#1

Hiya, so i want a textdraw to pop up if a player from team A shoots another player from team A.

Im not sure which callback i should use it for.

Any help is appreciated, thanks
Reply
#2

In the
pawn Код:
OnPlayerGiveDamage
call back check if the playerid and damageid are of same team..if they are same show textdraw or do nothing.
OR
You can use this custom callback https://sampforum.blast.hk/showthread.php?pid=937824#pid937824
Reply
#3

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Reply
#4

warn the guy
Reply
#5

Hiya, i use:

static gTeam[MAX_PLAYERS];

gTeam[playerid] = TEAM_POL;

gTeam[playerid] = TEAM_TER;
Reply
#6

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(gTeam[playerid] == gTeam[damageid])
    {
        new Float:Health, Float:Armour;
        GetPlayerHealth(damagedid,Health);
        GetPlayerArmour(damagedid, Armour);
        GameTextForPlayer(playerid,"~r~Team-Kill ~w~is ~r~NOT ~w~Allowed",2000,3); // Show the player message for 2 mins.
        if(Armour > 0)
        {
            SetPlayerArmour(damagedid,Armour+amount); // Restore the lost Armour amount.
        }
        else
        {
            SetPlayerHealth(damagedid,Health+amount); // Restore the lost Health amount.
        }
    }
    return 1;
}
Reply
#7

thank you..much appreciated i would rep you if i could xD
Reply
#8

SetPlayerTeam or OnPlayerTakeDamage instead of give. give = shoot skin, take = dude gets shot on his screen
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)