Friendly fire
#1

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

SetPlayerTeam(playerid, X);
Reply
#3

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

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

but then how I will set teams ?
Reply
#6

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.
Reply
#7

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);
}
Reply
#8

I WANT THE BULLETS TO HURT THE PLAYERS ON THE SAME TEAM
Reply
#9

THEN DON'T USE SETPLAYERTEAM. THATS WHAT IT DOES.
Reply
#10

what else can I use ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)