Jump to content
  • 0

pomoc IsPlayerInArea


Guest Norhy

Dotaz

#include 

forward isPlayerInArea();

public OnFilterScriptInit()
{
   AddPlayerClass(0,1280.4567,-812.2783,83.4426,181.1336,0,0,0,0,0,0); // Admin's spawni
SetTimer("isPlayerInArea", 1000, 1);
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public isPlayerInArea()
  {
      new Float:X, Float:Y, Float:Z; //We use this to store player position
      for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
      {
          GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
          if (X <= 1294.3558 && X >= 1269.0343 && Y <= -833.3308 && Y >= -825.7401)
          /* This line is the important one!. Here, is where you change those numbers, by the ones
          you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
          doesnt matter*/
          {
              SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
          }
      }
  }

 

Pls čo je na tom zle? Keď hráč vstupi do tej zóni malo by ho zabiť, ale nezabije..

Link to comment
Share on other sites

2 odpovědí na tuto otázku

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...