Error IsPlayerInArea
#1

pawn Код:
public OnGameModeInit()
{
  if(IsPlayerInArea(playerid,2690,2720,2740,2770,100);
  SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
}

pwn(380) : error 017: undefined symbol "IsPlayerInArea"
pwn(380) : error 001: expected token: ")", but found ";"
pwn(380) : error 036: empty statement
pwn(380) : fatal error 107: too many error messages on one line

Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)