Anti Team-Kill
#1

I saw in many CnR servers that Cops when they shoot another Cop , Their Health don't decrease how can i make it , shall i make it with OnPlayerTakeDamage ?
Reply
#2

pawn Код:
SetPlayerTeam(playerid, TEAM);
TeamVariable[playerid] = TEAM_SOMETHING;
Reply
#3

https://sampwiki.blast.hk/wiki/SetPlayerTeam

https://sampwiki.blast.hk/wiki/EnableVehicleFriendlyFire
Reply
#4

can you make it in code , can't get it , or is there a tutorial or something like this
Reply
#5

Quote:
Originally Posted by nor15
Посмотреть сообщение
can you make it in code , can't get it , or is there a tutorial or something like this
Just use this to setup your teams..
pawn Код:
stock TeamOne
{
     SetPlayerTeam(playerid, TeamOne);
     TeamVariable[playerid] = TeamOne;
     return 1;
}

stock TeamTwo
{
     SetPlayerTeam(playerid, TeamTwo);
     TeamVariable[playerid] = TeamTwo;
     return 1;
}
That will prevent players from the same team kill each other. Recommended to use this stocks OnPlayerRequestClass.
Reply
#6

You mean For example :
Код:
#define TEAM_COPS 0
Stock TeamOne
{
       SetPlayerTeam(playerid, TeamOne);
       TeamVariable[playerid] = TeamOne;
       return 1;
}
Public OnPlayerSpawn(playerid)
{
     If(gTeam[playerid] == TEAM_COPS)
     {
           TeamOne(playerid);
           return 1;
     }
}
Reply
#7

Bump!
Reply
#8

show us OnPlayerSpawn
Reply
#9

I didn;t create it yet , I'm only making an Example , is it right or wrong ?
Reply
#10

The theory is simple.

If a player's team matches to another player's team, those two players with the same team cannot attack each other.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)