Error IsPlayerInArea
#2

In the top of your script:

pawn Код:
forward isPlayerInArea();
In your filter-/gamemode init:

pawn Код:
SetTimer("isPlayerInArea", 1000, 1);
In the bottom of your script:

pawn Код:
public isPlayerInArea()
  {
    new Float:X, Float:Y, Float:Z;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
      GetPlayerPos(i, X, Y, Z);
      if (X <= [max X-coor.] && X >= [max X-coor.] && Y <= [max Y-coor.] && Y >= [max Y-coor.])
    }
  }
* coor. = coordinates

To get the coordinates, use;
pawn Код:
if (strcmp("/pos", cmdtext, true) == 0)
  {
    new string1[256];
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    format(string1,sizeof(string1),"Position = X: %.0f , Y: %.0f , Z: %.0f",X,Y,Z);
    SendClientMessage(playerid,COLOR_GREEN,string1);
    return 1;
  }
Reply


Messages In This Thread
Error IsPlayerInArea - by Freddy Z - 24.06.2010, 18:01
Re: Error IsPlayerInArea - by MastahServers - 24.06.2010, 18:14

Forum Jump:


Users browsing this thread: 1 Guest(s)