SA-MP Forums Archive
Friendly fire - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Friendly fire (/showthread.php?tid=196140)



Friendly fire - marinov - 04.12.2010

I did search but didn't find anything on how to enable friendly fire, so how do I do it ?


AW: Friendly fire - Meta - 04.12.2010

SetPlayerTeam(playerid, X);


Re: Friendly fire - marinov - 04.12.2010

that will turn friendly fire off, I want to turn it on


Re: Friendly fire - iggy1 - 04.12.2010

pawn Код:
SetPlayerTeam(playerid, NO_TEAM);
This forum requires that you wait 120 seconds between posts. Please try again in 10 seconds.


Re: Friendly fire - marinov - 04.12.2010

but then how I will set teams ?


Re: Friendly fire - iggy1 - 04.12.2010

The only time bullets wont hurt you is if your in the same team as the person shooting you, so if two players are on the same team they cant hurt each other.


Re: Friendly fire - scottyishere - 04.12.2010

pawn Код:
OnPlayerDeath(playerid,killerid)
{
    if(GetPlayerTeam(playerid)==GetPlayerTeam(killerid))
    {
         print("Friendly fire!");
    }
}
I never used this function but this is what I recall. If you don't want to use GetPlayerTeam, you can always use a normal variable.

I don't really know what you mean, but this is what I understood.
You need to SetPlayerTeam each player for this to work:
pawn Код:
//this is not working
OnPlayerConnect(playerid)
{
   if(...) SetPlayerTeam(playerid,X);
   else SetPlayerTeam(playerid,X);
}



Re: Friendly fire - marinov - 04.12.2010

I WANT THE BULLETS TO HURT THE PLAYERS ON THE SAME TEAM


Re: Friendly fire - iggy1 - 04.12.2010

THEN DON'T USE SETPLAYERTEAM. THATS WHAT IT DOES.


Re: Friendly fire - marinov - 04.12.2010

what else can I use ?