SA-MP Forums Archive
Need some help with "y_dohook" - 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: Need some help with "y_dohook" (/showthread.php?tid=323340)



Need some help with "y_dohook" - muckles - 05.03.2012

Hello everyone.
I'm new in this forum and I don't know if I posted where i sould post.
As I say'd I need a little help with "y_dohook"
When I wnat to compile I get 3 warnings:
Код:
y_dohooks.inc(123) : warning 219: local variable "to" shadows a variable at a preceding level
y_dohooks.inc(3358) : warning 235: public function lacks forward declaration (symbol "OnPlayerTakeDamage")
y_dohooks.inc(3427) : warning 235: public function lacks forward declaration (symbol "OnPlayerGiveDamage")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
And here are the lines:
Код:
123: Hooks_RedirectPublic(from[], to[])
{
	P:4("Hooks_RedirectPublic called: \"%s\", \"%s\"", from, to);
	new
		addr;
	if (AMX_GetPublicEntry(0, addr, from))
	{
		new
			pointer,
			ret = AMX_Read(addr);
		if (AMX_GetPublicPointer(0, pointer, to))
		{
			AMX_Write(addr, pointer);
		}
		else
		{
			// Can't find the next element, just remove this callback entirely.
			// Note that in some cases the previous ALS include will have
			// already (due to the constant chaining order) determined that
			// there IS a next callback for this type (because there is) and set
			// some internal variable stating this fact.  When it comes to call
			// it, however, the callback will no longer exist (unless PAWN
			// buffers callbacks in an efficient structure, which is possible).
			// UPDATE: Clearly not.
			AMX_Write(addr, -1);
	148:	}  (from 123 to 148 all line)
Код:
3358: public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
3427: public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
Thanks all
Regards (:


Re: Need some help with "y_dohook" - R0FLC0PTER - 05.03.2012

Make sure you have a_samp included (and updated).
That should fix the `public function lacks forward declaration` warnings.

For the first warning, `local variable "to" shadows a variable at a preceding level`:
You probably have a global variable (or variable in enum) of wich its name is "to".
Find it, and rename it to something else. (And all references to it in your script).