27.01.2011, 04:18
Quote:
when i use foreach i get this when i compile it
C:\Users\Legit_V20\Desktop\GTASanAndreas\pawno\inc lude\foreach.inc(140) : fatal error 111: user error: "Please include a_samp or a_npc before foreach" Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |

Anyways here is the .amx, dunno why you can't compile it AMX: http://www.2shared.com/file/fRWgZyGm/dropgun.html
or just comment out foreach and change the last function to this
pawn Код:
stock SendLocalMessage(playerid, msg[], Float:MessageRange, Range1color, Range2color)
{
new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
for(new i = 0; i < MAX_PLAYERS; i ++ )
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, MessageRange, PlayerX, PlayerY,PlayerZ))
{
SendClientMessage(i, Range1color, msg);
}
else if(IsPlayerInRangeOfPoint(i, MessageRange/2.0, PlayerX, PlayerY,PlayerZ))
{
SendClientMessage(i, Range2color, msg);
}
}
}
}