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

Alright I try...

I changed the code to 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 );
	GetPlayerName(playerid,name,sizeof(name));
	new EnterGZ[MAX_PLAYERS];

	if( PosX >= XMin && PosY >= YMin && PosX < XMax && PosY < YMax )
	{
      //GROVEZONE
	    if(PosX >= 1923.388 && PosY >= -1930.57 && PosX < 2847.478 && PosY < -1492.37)
	    {
      format(string,sizeof(string),"%s Is In Grove Street Family Street Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
	    }

	    //BALLASZONE
      if(PosX >= 1611.556 && PosY >= -1496.318 && PosX < 2261.841 && PosY < -1006.798)
      {
      format(string,sizeof(string),"%s Is In Ballas Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
      //VAGOSZONE
      if(PosX >= 2280.885 && PosY >= -1484.475 && PosX < 2893.112 && PosY < -1077.857)
      {
      format(string,sizeof(string),"%s Is In LS Vagos Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
	    //AZTECASZONE
      if(PosX >= 1349.16 && PosY >= -2041.106 && PosX < 1908.177 && PosY < -1504.214 )
      {
      format(string,sizeof(string),"%s Is In Varios Los Aztecas Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
      }
	    //PUNKZONE
      if(PosX >= 927.0455 && PosY >= -1504.214 && PosX < 1622.964 && PosY < -967.3207 )
      {
      format(string,sizeof(string),"%s Is In Punk's Territority!",name);
	    SendClientMessageToAll(COLOR_GREEN,string);
	    EnterGZ[playerid] = 1;
			}
	    RetValue = 1;
	}
	return RetValue;
}

public GangAlarm(playerid)
{
	 for (new i=1;i < MAX_PLAYERS;i++)
	 {
	  
			if(IsPlayerConnected(i) == 1)
			{
			new Float:XMin,Float:YMin,Float:XMax,Float:YMax;
			IsPlayerInZone(playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax);
			}
   }
}
BEFORE:
Код:
if(XMax < 2847.478 && XMin > 1923.388 && YMax < -1492.37 && YMin > -1930.57)
AFTER
Код:
if(PosX >= 1923.388 && PosY >= -1930.57 && PosX < 2847.478 && PosY < -1492.37)
and I do not change GangA to SetPlayerTimer, because I need It to Kill the Timer On game mode exit ^^

Bearfist
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)