SA-MP Forums Archive
Killing player in other team in the area - 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: Killing player in other team in the area (/showthread.php?tid=337078)



Killing player in other team in the area - Deviant96 - 24.04.2012

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:XFloat:YFloat:Z
    for(new 
i=0MAX_PLAYERSi++) 
    {
        
GetPlayerPos(iXYZ); 
        if (
gTeam[i] != TEAM_MARINES && <= 2478.038 && >= 2700.614 && <= 2672.355 && >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_OPFOR && <= 2478.038 && >= 2700.614 && <= 2672.355 && >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_SAS && <= 2478.038 && >= 2700.614 && <= 2672.355 && >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
        if (
gTeam[i] != TEAM_TERO && <= 2478.038 && >= 2700.614 && <= 2672.355 && >= 2846.418)
        {
        
SetPlayerHealth(i, -999999.9);
        }
    }




Re: Killing player in other team in the area - Crazymax - 24.04.2012

Y <= 2672.355 && Y >= 2846.418

should be

Y >= 2672.355 && Y <= 2846.418

understand why?


Re: Killing player in other team in the area - Deviant96 - 24.04.2012

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


Re: Killing player in other team in the area - Squirrel - 25.04.2012

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

Set this on
"OnPlayerUpdate"

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