SA-MP Forums Archive
PlayerToPoint Problem... - 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: PlayerToPoint Problem... (/showthread.php?tid=86853)



PlayerToPoint Problem... - stieben - 16.07.2009

Very hello,

I have an extremely simple code, BUT I got an error in it.

On Top:
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
On Bottom:
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
  {
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	tempposx = (oldposx -x);
	tempposy = (oldposy -y);
	tempposz = (oldposz -z);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
	return 1;
	}
	}
	return 0;
	}
This equals my error:
Код:
warning 235: public function lacks forward declaration (symbol "PlayerToPoint")
Extreme Thanks




Re: PlayerToPoint Problem... - abhinavdabral - 16.07.2009

Make sure that you have added the forward just after #defines


Re: PlayerToPoint Problem... - stieben - 16.07.2009

Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
This is all I got on top. It's a new script u know. As you see there are no defines, only #if defined FILTERSCRIPT, but I don't thingk that's a define


Re: PlayerToPoint Problem... - abhinavdabral - 16.07.2009

add it just below #include <a_samp>
IT will 100% work then.

Thank You
-Abhinav


Re: PlayerToPoint Problem... - stieben - 16.07.2009

lol, it really works

Thanks!!


Re: PlayerToPoint Problem... - abhinavdabral - 16.07.2009

Nice .........
No Problem Mate