SA-MP Forums Archive
Gang zone help - 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: Gang zone help (/showthread.php?tid=166963)



Gang zone help - MWF2 - 10.08.2010

How can i detect if a player is in a gangzone, and if they are a command could work.



So, I want it so if a player is in a certain gangzone and i type /moveplayer 5 it moves id 5 out of the gangzone and teleports outside the gangzone.


I know how to do the whole teleport command and everything, but how can i detect if a player is in a gangzone in the first place?



EDIT: So what i need is, IsPlayerInArea to work with this gang zone: gangzone = GangZoneCreate(1830.3060, -2460.9521, 1883.3285, -2406.4404);

So if someone enters it displays a message like "Noob"


Re: Gang zone help - willsuckformoney - 10.08.2010

i love'd to see if that exist, im also working on it now


Re: Gang zone help - MWF2 - 10.08.2010

It does exist because i was on a server, and when a player entered a gang zone it would send them a message.


Maybe they use isplayerinarea?



How do I use IsPlayerInArea? Like, This is my gang zone:

pawn Code:
gangzone = GangZoneCreate(1830.3060, -2460.9521, 1883.3285, -2406.4404);


So for IsPlayerInArea do i use the same cords? Like This:

pawn Code:
public CheckAdminArea()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInArea(i,(1830.3060, -2460.9521, 1883.3285, -2406.4404) && !IsPlayerAdmin(i))
        {
            //Do your stuff
                        SetPlayerHealth(i,0); // Kills him, for example.
        }
    }
    return 1;
}

If so, I tried tat, and it didn't work when i was in the gang zone....


Re: Gang zone help - WillyP - 10.08.2010




Re: Gang zone help - MWF2 - 10.08.2010

Can you help me lolrofl


Re: Gang zone help - MWF2 - 10.08.2010

Ok, Here is my gang zone. It works perfect. Goes right over the spot i need it to over.

pawn Code:
gangzone = GangZoneCreate(1830.3060, -2460.9521, 1883.3285, -2406.4404);
This is my IsPlayerInArea. It's the same cords as my gang zone except i put it in the format max x and min x and max y and min y.

Can someone please help

pawn Code:
forward CheckLSVSArea();

SetTimer("CheckLSVSArea",3000,1);

public CheckLSVSArea()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInArea(i,1883.3285,1830.3060,-2406.4404,-2460.9521))
        {

        SendClientMessage(i,0x1E90FFAA, "NOOB");
        }
    }
    return 1;
}



Re: Gang zone help - ruckfules99 - 10.08.2010

I'd like to know the same thing plz


Re: Gang zone help - MWF2 - 11.08.2010

Bump please help


Re: Gang zone help - WillyP - 11.08.2010

Ill help, but tomorrow when i get my lappy


Re: Gang zone help - MWF2 - 11.08.2010

Ok, thanks