SA-MP Forums Archive
Giveplayer wanted when attack someone - 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: Giveplayer wanted when attack someone (/showthread.php?tid=493675)



Giveplayer wanted when attack someone - iThePunisher - 09.02.2014

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?


Re: Giveplayer wanted when attack someone - AlonzoTorres - 09.02.2014

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;
}