Giveplayer wanted when attack someone
#1

i made my server but i cant do it if Team civilian shot at other players cops/other civilians etc to get wanted level 2

and for cops if team cop attack team army team fbi . to give him warning and to announce in his screen "do not attack your team mates"

can someone help me in this?
Reply
#2

Use OnPlayerGiveDamage and check if the playerid and damagedid's variables are equal.

PSEUDO CODE:
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if(!strcmp(playerInfo[playerid][pTeam], playerInfo[damagedid][pTeam], true)){
        SendClientMessage(playerid, COLOR_DARKRED, "Don't hurt your teammate.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)