again a isplayerinarea noob ^^ - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: again a isplayerinarea noob ^^ (
/showthread.php?tid=66240)
again a isplayerinarea noob ^^ -
mirkoiz - 20.02.2009
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?
Re: again a isplayerinarea noob ^^ -
Daren_Jacobson - 20.02.2009
i hate i when people do this, we need to know the exact line the errors are on
Re: again a isplayerinarea noob ^^ -
ICECOLDKILLAK8 - 20.02.2009
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
Re: again a isplayerinarea noob ^^ -
mirkoiz - 20.02.2009
sry ^^
it gives me the error at the last "}"
Re: again a isplayerinarea noob ^^ -
x-cutter - 21.02.2009
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?