again a isplayerinarea noob ^^
#1

Hello... i have this..

On the Top:
pawn Код:
forward CustomPickups(playerid);
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
  //Min X Max X Min Y Max Y
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  if (x >= minx && x <= maxx && y >= miny && y <= maxy) return 1;
  return 0;
}

Function to check the area
pawn Код:
public CustomPickups(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInArea(i, 87.8908, -971.2684, 1345.357, -884.4181) || IsPlayerInArea(i, 698.8753, -1314.722, 812.9604, -1227.872))
             {
            TextDrawShowForPlayer(i, Textdraw);
             }
             else
             {
                 TextDrawHideForPlayer(i, Textdraw);
             }
        }
    }
}
the Error:
Код:
C:\DOKUME~1\Plato\Desktop\GM\EUROVE~1\GAMEMO~1\grl.pwn(32134) : error 029: invalid expression, assumed zero
C:\DOKUME~1\Plato\Desktop\GM\EUROVE~1\GAMEMO~1\grl.pwn(32134) : warning 215: expression has no effect
C:\DOKUME~1\Plato\Desktop\GM\EUROVE~1\GAMEMO~1\grl.pwn(32134) : error 001: expected token: ";", but found "if"
knows anyone to fix that?
Reply
#2

i hate i when people do this, we need to know the exact line the errors are on
Reply
#3

well for starters you dont need to use
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
as the default values for variables is 0
Reply
#4

sry ^^

it gives me the error at the last "}"
Reply
#5

Better indent pls
http://cutter.pastebin.com/m774cb036

I don't see any problems. Are you sure it's that piece of code? Maybe you're pointing out the wrong line or something, since I see no errors in this simple code.

Oww why your function got "playerid" in it if you're not even using it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)