If Is Player In Gangzone... How to create a function like that ??
#3

Now my code looks like this:

Код:
stock IsPlayerInZone( playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax )
{
	new RetValue = 0;
	new Float: PosX, Float: PosY, Float: PosZ;
	GetPlayerPos( playerid, PosX, PosY, PosZ );

	if( PosX >= XMin && PosY >= YMin && PosX < XMax && PosY < YMax )
	{
	  RetValue = 1;
	}
	return RetValue;
}

public GangAlarm(playerid)
{
	  for (new i=0;i < MAX_PLAYERS;i++)
	  {
	  
			if(IsPlayerConnected(i) == 1)
			{
			GetPlayerName(playerid,name,sizeof(name));
	    new EnterGZ[MAX_PLAYERS];
	    new Float:XMin, Float:YMin, Float:XMax, Float: YMax;
			IsPlayerInZone(playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax);
				//GROVEZONE
	    if(XMax < 2847.478 && XMin > 1923.388 && YMax < -1492.37 && YMin > -1930.57)
	    {
      format(string,sizeof(string),"%s Is In Grove Street Family Street Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
	    }
	    //BALLASZONE
      if(XMax < 2261.841 && XMin > 1611.556 && YMax < -1006.798 && XMin > -1496.318)
      {
      format(string,sizeof(string),"%s Is In Ballas Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
      //VAGOSZONE
      if(XMax < 2893.112 && XMin > 2280.885 && YMin < -1077.857 && YMax > -1484.475)
      {
      format(string,sizeof(string),"%s Is In LS Vagos Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
	    //AZTECASZONE
      if(XMax < 1908.177 && XMin > 1349.16 && YMax < -1504.214 && YMin > -2041.106)
      {
      format(string,sizeof(string),"%s Is In Varios Los Aztecas Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
	    //PUNKZONE
      if(XMax < 1622.964 && XMin > 927.0455 && YMax < -967.3207 && YMin > -1504.214)
      {
      format(string,sizeof(string),"%s Is In Punk's Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
			}
			}
    }
}
PS: There are no warnings an errors ... but it doesn't works =(
Help...

Bearfist
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)