Killing player in other team in the area
#1

How to kill player in the other team if they're in the exact area?

I got this

PHP код:
static gTeam[MAX_PLAYERS];
#define TEAM_MARINES 1
#define TEAM_OPFOR 2
#define TEAM_SAS 3
#define TEAM_TERO 4
public isPlayerInArea()
{
    new 
Float:X, Float:Y, Float:Z; 
    for(new 
i=0; i < MAX_PLAYERS; i++) 
    {
        
GetPlayerPos(i, X, Y, Z); 
        if (
gTeam[i] != TEAM_MARINES && X <= 2478.038 && X >= 2700.614 && Y <= 2672.355 && Y >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_OPFOR && X <= 2478.038 && X >= 2700.614 && Y <= 2672.355 && Y >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_SAS && X <= 2478.038 && X >= 2700.614 && Y <= 2672.355 && Y >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_TERO && X <= 2478.038 && X >= 2700.614 && Y <= 2672.355 && Y >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
    }
} 
Reply
#2

Y <= 2672.355 && Y >= 2846.418

should be

Y >= 2672.355 && Y <= 2846.418

understand why?
Reply
#3

Okay, i can't understand the difference. Could you tell me why, please?
Reply
#4

Well, let's set team 1 that cannot reach some area

Set this on
"OnPlayerUpdate"

PHP код:
if(GetPlayerTeam < 2)
{
              
IsPlayerInRangeOfPoint(playerid,  etc..[/LEFT]
              {
                      
SetPlayerHealth(playerid, 0); 
Reply


Forum Jump:


Users browsing this thread: