SA-MP Forums Archive
[YSI] y_hooks Error - 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: [YSI] y_hooks Error (/showthread.php?tid=577073)



[YSI] y_hooks Error - VladimirMark - 08.06.2015

I got this error which I can't really understand what's going on with YSI.
Hope you can explain me this.

Код:
C:\Users\Vlad\Desktop\New folder (2)\pawno\include\YSI\y_hooks/impl.inc(834) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I know this error comes from the ELC Anti-Cheat include that I include in the script and still nothing...


I posted this on another topic but I don't get any reply from the thread starter.


Re: [YSI] y_hooks Error - Konstantinos - 08.06.2015

Giving us the error itself doesn't help a lot, post the line 834 from y_hooks/impl.inc


Re: [YSI] y_hooks Error - VladimirMark - 08.06.2015

Код:
public OnVehicleDeath(vehicleid, killerid)
{
	P:2("Hooks_OnVehicleDeath called: %d, %d", vehicleid, killerid);
	new
		end   = _:YSI_g_sCallbackEnd[ALS_OnVehicleDeath],
		start = _:YSI_g_sCallbackStart[ALS_OnVehicleDeath],
		ret = ALS_R_VehicleDeath;
	while (start++ != end)
	{
		#emit PUSH.S killerid
		#emit PUSH.S vehicleid
		#emit PUSH.C     8
		#emit CONST.alt  YSI_g_sCallbackAddresses
		#emit LOAD.S.pri start
		//#emit INC.pri
		//#emit STOR.S.pri start
		#emit LIDX
		#emit MOVE.alt
		#emit LCTRL      6
		#emit ADD.C      24
		#emit PUSH.pri
		#emit MOVE.pri
		#emit SCTRL      6
		#emit MOVE.alt
		#emit CONST.pri  0xFFFFFFFE
		#emit AND
		#emit PUSH.pri
		#emit LOAD.S.pri ret
		#emit AND
		#emit POP.alt
		#emit OR
		#emit STOR.S.pri ret
		if (ret < 0) return ret + 1;
	}
	return ret;
}



Re: [YSI] y_hooks Error - Konstantinos - 08.06.2015

Yes, the problem is with ELC. It doesn't have "killerid" parameter.

Replace:
pawn Код:
public OnVehicleDeath(vehicleid)
{
    CheatVehicleInfo[vehicleid][elc_vX]=0;
        #if defined INCLUDE_BASE_MODE
        return CallLocalFunction("ELC_AC_OnVehicleDeath", "d",vehicleid);
        #else
        return 1;
        #endif
}
/*----------------------------------------------------------------------------*/
#if defined INCLUDE_BASE_MODE
//ALS_SYSTEME --------------------
#if defined _ALS_OnVehicleDeath
        #undef OnVehicleDeath
#else
        #define _ALS_OnVehicleDeath
#endif
#define OnVehicleDeath ELC_AC_OnVehicleDeath
forward ELC_AC_OnVehicleDeath(vehicleid);
#endif
with:
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    CheatVehicleInfo[vehicleid][elc_vX]=0;
        #if defined INCLUDE_BASE_MODE
        return CallLocalFunction("ELC_AC_OnVehicleDeath", "dd",vehicleid, killerid);
        #else
        return 1;
        #endif
}
/*----------------------------------------------------------------------------*/
#if defined INCLUDE_BASE_MODE
//ALS_SYSTEME --------------------
#if defined _ALS_OnVehicleDeath
        #undef OnVehicleDeath
#else
        #define _ALS_OnVehicleDeath
#endif
#define OnVehicleDeath ELC_AC_OnVehicleDeath
forward ELC_AC_OnVehicleDeath(vehicleid, killerid);
#endif



Re: [YSI] y_hooks Error - VladimirMark - 08.06.2015

Works and thanks for your help.