SA-MP Forums Archive
[Help] YSI\y_hooks error [[+REP]] - 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: [Help] YSI\y_hooks error [[+REP]] (/showthread.php?tid=578743)



[Help] YSI\y_hooks error [[+REP]] - alanmn88 - 21.06.2015

Hi! So i'm personalizing my Server GM ((v0.3.7)) and the Pawno Compiler get me this error:

C:\Users\MLG_OPBoT\Desktop\GTA San Andreas\SERVER\pawno\include\YSI\y_hooks/impl.inc(2336) : error 025: function heading differs from prototype
C:\Users\MLG_OPBoT\Desktop\GTA San Andreas\SERVER\pawno\include\YSI\y_hooks/impl.inc(2383) : error 025: function heading differs from prototype


The lines are 2336:

Код:
foreach(Player, i)
			{
			    if(IsACop(i))
			    {
					new Saved = (TotalRobbers*50000-(TotalStolen*50000));
					GiveZaiatMoney(i, Saved/copsonline);
					format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
					SendClientMessage(i, COLOR_LIME, string);
			    }
			}
		}
    }
	// 3D Text
	/*Delete3DTextLabel(AltTabText[playerid]);
	Delete3DTextLabel(AFKText[playerid]);
	Delete3DTextLabel(aDutyText[playerid]);
	Delete3DTextLabel(VIPText[playerid]);*/
	if(IsValidDynamic3DTextLabel(AltTabText[playerid])) DestroyDynamic3DTextLabel(AltTabText[playerid]);
	if(IsValidDynamic3DTextLabel(AFKText[playerid]))DestroyDynamic3DTextLabel(AFKText[playerid]);
	if(IsValidDynamic3DTextLabel(aDutyText[playerid]))DestroyDynamic3DTextLabel(aDutyText[playerid]);
	if(IsValidDynamic3DTextLabel(hDutyText[playerid]))DestroyDynamic3DTextLabel(hDutyText[playerid]);
	if(IsValidDynamic3DTextLabel(VIPText[playerid]))DestroyDynamic3DTextLabel(VIPText[playerid]);
	if(IsValidDynamic3DTextLabel(MaskText[playerid]))DestroyDynamic3DTextLabel(MaskText[playerid]); // Masklabel
	// Timers
And 2383:

Код:
// Contract
	format(PlayerInfo[playerid][pContractBy], 32, "");
	format(PlayerInfo[playerid][pContractDetail], 64, "");
	// Warns
	format(PlayerInfo[playerid][pWarn1], 64, "");
	format(PlayerInfo[playerid][pWarn2], 64, "");
	format(PlayerInfo[playerid][pWarn3], 64, "");
	format(PlayerInfo[playerid][pWarn4], 64, "");
	format(PlayerInfo[playerid][pWarn5], 64, "");
	// Spam
	format(OldSpamCommand[playerid], 128, "");
	format(NewSpamCommand[playerid], 128, "");
	format(OldSpamChat[playerid], 128, "");
	format(NewSpamChat[playerid], 128, "");
	// Flag
	format(PlayerInfo[playerid][pFlag], 64, "");
	// Accent
	format(PlayerInfo[playerid][pAccent], 16, "");
	// VIP Name
I really dont know if the error starts from the code or the "include file: y_hook/impl.inc"
PLS anyone can help me?


Re: [Help] YSI\y_hooks error [[+REP]] - Konstantinos - 21.06.2015

https://sampforum.blast.hk/showthread.php?pid=2879597#pid2879597


Respuesta: [Help] YSI\y_hooks error [[+REP]] - alanmn88 - 21.06.2015

The post Didn't help me :v


Re: [Help] YSI\y_hooks error [[+REP]] - Crayder - 21.06.2015

The problem is most likely your SA-MP version vs YSI version. So tell us what version of each of those you have.


Respuesta: [Help] YSI\y_hooks error [[+REP]] - alanmn88 - 21.06.2015

My Samp version is 0.3.7 (i specified that in the post, but no problem ) and the entire script is optimized for 0.3.7 and i "think" i have the latest version of YSI from here: http://sendupload.cba.pl/getfile.php?id=225


Respuesta: [Help] YSI\y_hooks error [[+REP]] - alanmn88 - 21.06.2015

Well, im an idiot i didnt read the entire message and the code from my post is wrong


Re: [Help] YSI\y_hooks error [[+REP]] - Crayder - 21.06.2015

Quote:

i "think" i have the latest version of YSI

No you have an old YSI (elder version of 3, which is not compatible with 0.3z and up because of OPTD and OPGD). Download YSI 4.0.


Respuesta: [Help] YSI\y_hooks error [[+REP]] - alanmn88 - 21.06.2015

First line is the 2336 error:


public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
P:2("Hooks_OnPlayerTakeDamage called: %d, %d, %f, %d, %d", playerid, issuerid, Float:amount, weaponid, bodypart);
new
end = _:YSI_g_sCallbackEnd[ALS_OnPlayerTakeDamage],
start = _:YSI_g_sCallbackStart[ALS_OnPlayerTakeDamage],
ret = ALS_R_PlayerTakeDamage;
while (start++ != end)
{
#emit PUSH.S bodypart
#emit PUSH.S weaponid
#emit PUSH.S amount
#emit PUSH.S issuerid
#emit PUSH.S playerid
#emit PUSH.C 16
#emit CONST.alt YSI_g_sCallbackAddresses
#emit LOAD.S.pri start
//#emit INC.pri
//#emit STOR.S.pri start



Re: [Help] YSI\y_hooks error [[+REP]] - Konstantinos - 21.06.2015

"bodypart" parameter does exist in the file you linked above so it was the updated version of it to fix those two errors. If you are sure that a_samp.inc is updated to 0.3.7 and the forwards are like this:
pawn Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
you better look at other includes that use those two callbacks.

Though, you should consider to YSI 4.0 as Crayder already suggested.


Re: [Help] YSI\y_hooks error [[+REP]] - Crayder - 21.06.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Though, you should consider to YSI 4.0 as Crayder already suggested.
Or at the least a fixed version of 3.1, but 4.0 is being updated and maintained by Misuir (and Y-Less, still) so you should go with that.