Hello guys Can you help me with this. - 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: Hello guys Can you help me with this. (
/showthread.php?tid=370835)
Hello guys Can you help me with this. -
Gangster-rocks - 21.08.2012
I have made an anti Team killing but its have a problem
When robber shot a cop the cop recover by his own and the same when cop shot robber.
the code
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(gTeam[playerid] == SWAT)
{
gTeam[damagedid] = SWAT;
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,COLOR_BLUE,"Stop Shooting your team mates");
SetPlayerHealth(damagedid,amount);
}
if(gTeam[playerid] == Robbers)
{
gTeam[damagedid] = Robbers;
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,COLOR_RED1,"Stop Shooting your mates");
SetPlayerHealth(damagedid,amount);
}
return 1;
}
Re: Hello guys Can you help me with this. -
Gangster-rocks - 21.08.2012
Solved
Re: Hello guys Can you help me with this. -
Littlehelper - 21.08.2012
You can simply use "SetPlayerTeam" to prevent team-shooting.