Border FS?
#8

Quote:
Originally Posted by thimo
Посмотреть сообщение
Use if(!IsPlayerInRangeOfPoint(...)) and set timer and then kill if he still not back in area
Why not using IsPlayerInArea instead?

pawn Код:
stock IsPlayerInArea(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if((minx <= x <= maxx) && (miny <= y <= maxy)) return true;
    return false;
}
Also... You are using SetTimer instead of SetTimerEx = Your code will only work for ID 0!

pawn Код:
forward Bounds();
public Bounds()
{
      /*
      { "Bone County",                  -480.50,   596.30,  -242.90,   869.40,  2993.80,   900.00},
      { "Tierra Robada",               -2997.40,  1659.60,  -242.90,  -480.50,  2993.80,   900.00},
      { "Tierra Robada",               -1213.90,   596.30,  -242.90,  -480.50,  1659.60,   900.00},
      */

      foreach(Player, playerid) //Change to "for(new playerid; playerid < MAX_PLAYERS; playerid++)" if you don't have foreach
      {
              if(!IsPlayerInArea(playerid, -480.50, 596.30, 869.40,  2993.80) && !IsPlayerInArea(playerid, -2997.40,  1659.60, -480.50,  2993.80) && !IsPlayerInArea(playerid, -1213.90,   596.30, -480.50,  1659.60))
              {
                      SetTimerEx("Kill", 5000, false, "d", playerid);
                      return 1;
              }
      }
      return 1;
}
pawn Код:
forward Kill(playerid);
public Kill(playerid)
{
      if(!IsPlayerInArea(playerid, -480.50, 596.30, 869.40,  2993.80) && !IsPlayerInArea(playerid, -2997.40,  1659.60, -480.50,  2993.80) && !IsPlayerInArea(playerid, -1213.90,   596.30, -480.50,  1659.60))
      {
            return 1; // Do nothing
      }
      else SetPlayerHealth(playerid, 0);
      return 1;
}
Reply


Messages In This Thread
Border FS? - by Gooday - 13.01.2012, 15:06
Re: Border FS? - by thimo - 13.01.2012, 15:12
Re: Border FS? - by Gooday - 13.01.2012, 15:21
Re: Border FS? - by Gooday - 13.01.2012, 15:31
Re: Border FS? - by thimo - 13.01.2012, 15:34
Re: Border FS? - by Gooday - 13.01.2012, 15:40
Re: Border FS? - by thimo - 13.01.2012, 15:51
Respuesta: Re: Border FS? - by OPremium - 13.01.2012, 16:46
Respuesta: Re: Border FS? - by OPremium - 13.01.2012, 16:57
Respuesta: Re: Border FS? - by OPremium - 13.01.2012, 17:34

Forum Jump:


Users browsing this thread: 2 Guest(s)