SA-MP Forums Archive
Error 012: invalid function call, not a valid address - 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)
+--- Thread: Error 012: invalid function call, not a valid address (/showthread.php?tid=574770)



Error 012: invalid function call, not a valid address - SandKing94 - 20.05.2015

Code:
Код:
stock SendNearbyMessage(playerid, Float:radius, string[], col)
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	new Float:ix, Float:iy, Float:iz;
	new Float:cx, Float:cy, Float:cz;
	foreach(Player, i)
	{
	    if(LoggedIn(i))
	    {
	        if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
	        {
				GetPlayerPos(i, ix, iy, iz);
				cx = (x - ix);
				cy = (y - iy);
				cz = (z - iz);
				if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
				{
				    SendClientMessage(i, col, string);
				}
			}
	    }
	}
	return 1;
}
Error line:
Код:
 if(LoggedIn(i))
Error:
Код:
error 012: invalid function call, not a valid address
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line



Re: Error 012: invalid function call, not a valid address - X337 - 20.05.2015

Show stock LoggedIn code.


Re: Error 012: invalid function call, not a valid address - SandKing94 - 20.05.2015

Its
new LoggedIn[MAX_PLAYERS];


Re: Error 012: invalid function call, not a valid address - Emmet_ - 20.05.2015

pawn Код:
if(LoggedIn(i))
To:

pawn Код:
if(LoggedIn[i])



Re: Error 012: invalid function call, not a valid address - justice96 - 20.05.2015

from:
Quote:

if(LoggedIn(i))

to:
Quote:

if(LoggedIn[i])




Re: Error 012: invalid function call, not a valid address - SandKing94 - 20.05.2015

Thanks