code:
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 <= 268 && X >= 240 && Y <= -1331 && Y >= -1407)
/* 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*/
{
SendClientMessageToAll(0xDEEE20FF, "IM SPERRGEBIET!"); // Ändern!
}
}
}
Problem: Das Script an sich funktioniert, bloß nicht richtig. Ich will eine Villa samt Garten drumherum als Mafia-Gebiet kennzeichnen. Dieses Script oben aus der amerikanischen Wiki scheint mir aber nur eine art Dreick einzuzäunen.
Schwarz: Mafiagebiet Gesamt
Blau: Mein erster Versuch mit den Koordinaten:
x: 296 y: -1358 z: 53
x: 205 y: -1383 z: 53
Gelb: Zweiter Versuch mit den Koordinaten:
x: 268 y: -1331 z: 53
x: 240 y: -1407 z: 53
Nun:
Wie schaffe ich es, das gesamte Quadrat einzuschließen?
Muss ich dazu noch 2 andere Koordinaten in die if-Abfrage einbauen?
Problem 2: Oben im Script steht als Kommentar Ändern!!
Ich hätte es gerne so, das so lange wie man in diesem eingegrenzten Gebiet ist im HUD die Nachricht angezeigt wird. Sie soll also so lange anbleiben wie man drin ist.
Liebe Grüße,
Danny
PS: Link zum Tutorial: KLICK