SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/01/2014, 02:45 AM   #1
[TC]XxJuggaloxX
Big Clucker
 
[TC]XxJuggaloxX's Avatar
 
Join Date: Jun 2011
Location: ug-gaming.net
Posts: 146
Reputation: 6
Default [FIX][YSI] error 025: function heading differs from prototype

*EDIT* This has been updated to fix some errors that have been found by some people. This should be working now! Enjoy! - 1/17/2014

If you are having this error
Code:
error 025: function heading differs from prototype
Download: REMOVED
-This is for those of you lazy people.

For the record, this literally took me 2 minutes to figure out how to fix this, hopefully this download will help you as they are mine, They arnt edited other than from what you see below, They work for me, so they should work for you.

This is what you need to do.

Navigate to:
\pawno\include\YSI\y_als

Open:
impl.inc

Find:
Code:
#define ALS_DO_PlayerTakeDamage<%0> %0<PlayerTakeDamage,iifi>(more:playerid,more:issuerid,Float:amount,end:weaponid)

Change to:
Code:
#define ALS_DO_PlayerTakeDamage<%0> %0<PlayerTakeDamage,iifii>(more:playerid,more:issuerid,Float:amount,more:weaponid,end:bodypart)

Find:
Code:
#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifi>(more:playerid,more:damagedid,Float:amount,end:weaponid)

Change to:
Code:
#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifii>(more:playerid,more:damagedid,Float:amount,more:weaponid,end:bodypart)

Save and Close the file.

Now thats done. You need to edit one more file.

Navigate to:
\pawno\include\YSI\y_hooks

Open:
impl.inc

Find:
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)

Change to:
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)

Find:
Code:
P:2("Hooks_OnPlayerTakeDamage called: %d, %d, %f, %d", playerid, issuerid, Float:amount, weaponid);

Change to:
Code:
P:2("Hooks_OnPlayerTakeDamage called: %d, %d, %f, %d, %d", playerid, issuerid, Float:amount, weaponid, bodypart);

Find:
Code:
while (start++ != end)
	{
		#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
		#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;
	}

Change to:
Code:
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
		#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;
	}


Find:
Code:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)

Change to:
Code:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)

Find:
Code:
P:2("Hooks_OnPlayerGiveDamage called: %d, %d, %f, %d", playerid, damagedid, Float:amount, weaponid);

Change to:
Code:
P:2("Hooks_OnPlayerGiveDamage called: %d, %d, %f, %d, %d", playerid, damagedid, Float:amount, weaponid, bodypart);

Find:
Code:
	while (start++ != end)
	{
		#emit PUSH.S weaponid
		#emit PUSH.S amount
		#emit PUSH.S damagedid
		#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
		#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;
	}

Change to:
Code:
	while (start++ != end)
	{
		#emit PUSH.S bodypart
		#emit PUSH.S weaponid
		#emit PUSH.S amount
		#emit PUSH.S damagedid
		#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
		#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;
	}
Save and Close the file.





Now go compile and have fun!
__________________
Any scripter that's likely to ever be any good will be the sort who finds out WHY you do things, not just WHAT you do.
If you explain why something is done people can improve your method or decide better when to use it and when to not.
- Y_Less


Last edited by [TC]XxJuggaloxX; 18/01/2014 at 03:28 AM. Reason: Fixed a few errors on my part.
[TC]XxJuggaloxX is offline   Reply With Quote
Old 17/01/2014, 03:04 AM   #2
Littl3j0hNy
Huge Clucker
 
Littl3j0hNy's Avatar
 
Join Date: Jan 2007
Posts: 477
Reputation: 26
Default AW: [FIX] error 025: function heading differs from prototype

thx for your fix but i still get one error on OnPlayerGiveDamage
__________________

FREEROAM / MISSIONS / RPG / RACE / DM / GANGS
Join us at www.party-server.com
Littl3j0hNy is offline   Reply With Quote
Old 17/01/2014, 03:10 AM   #3
[TC]XxJuggaloxX
Big Clucker
 
[TC]XxJuggaloxX's Avatar
 
Join Date: Jun 2011
Location: ug-gaming.net
Posts: 146
Reputation: 6
Default Re: [FIX] error 025: function heading differs from prototype

Look over the fix again, I updated it because I forgot 2 parts lol. Should work now.

This was updated

Code:
P:2("Hooks_OnPlayerGiveDamage called: %d, %d, %f, %d", playerid, damagedid, Float:amount, weaponid);
__________________
Any scripter that's likely to ever be any good will be the sort who finds out WHY you do things, not just WHAT you do.
If you explain why something is done people can improve your method or decide better when to use it and when to not.
- Y_Less

[TC]XxJuggaloxX is offline   Reply With Quote
Old 17/01/2014, 03:43 AM   #4
itsCody
Gangsta
 
Join Date: Nov 2012
Location: Canada
Posts: 532
Reputation: 45
Default Re: [FIX] error 025: function heading differs from prototype

This fixed OnPlayerTakeDamage however OnPlayerGiveDamage it doesn't seem to compile correctly.

error 025: function heading differs from prototype, and I also double checked the lines to make sure there wasn't any errors ectect
itsCody is offline   Reply With Quote
Old 17/01/2014, 04:07 AM   #5
[TC]XxJuggaloxX
Big Clucker
 
[TC]XxJuggaloxX's Avatar
 
Join Date: Jun 2011
Location: ug-gaming.net
Posts: 146
Reputation: 6
Default Re: [FIX] error 025: function heading differs from prototype

Quote:
Originally Posted by itsCody View Post
This fixed OnPlayerTakeDamage however OnPlayerGiveDamage it doesn't seem to compile correctly.

error 025: function heading differs from prototype, and I also double checked the lines to make sure there wasn't any errors ectect
Take everything you did for OnPlayerTakeDamage and do it to OnPlayerGiveDamage.
Both of these from what I have seen are the same, However, The Name (Obviously) are different from each other.


Here, These are mine, This should help.

https://www.mediafire.com/?1mwjdd8gvcfi7d6
__________________
Any scripter that's likely to ever be any good will be the sort who finds out WHY you do things, not just WHAT you do.
If you explain why something is done people can improve your method or decide better when to use it and when to not.
- Y_Less

[TC]XxJuggaloxX is offline   Reply With Quote
Old 17/01/2014, 05:13 AM   #6
itsCody
Gangsta
 
Join Date: Nov 2012
Location: Canada
Posts: 532
Reputation: 45
Default Re: [FIX] error 025: function heading differs from prototype

Quote:
Originally Posted by [TC]XxJuggaloxX View Post
Take everything you did for OnPlayerTakeDamage and do it to OnPlayerGiveDamage.
Both of these from what I have seen are the same, However, The Name (Obviously) are different from each other.


Here, These are mine, This should help.

https://www.mediafire.com/?1mwjdd8gvcfi7d6
Thanks, they're working!
BTW; your download is blocked due to DMCA Copyright.

Also; found an error in your code!

Code:
#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifi>(more:playerid,more:issuerid,Float:amount,more:weaponid,end:bodypart)

should be

Code:
#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifi>(more:playerid,more:damagedid,Float:amount,more:weaponid,end:bodypart)

Under \pawno\include\YSI\y_als

PlayerGiveDamage was calling issuerid instead of damagedid!
itsCody is offline   Reply With Quote
Old 17/01/2014, 06:06 AM   #7
iZN
High-roller
 
Join Date: Jun 2010
Location: Pakistan
Posts: 2,469
Reputation: 565
Default Re: [FIX] error 025: function heading differs from prototype

Also you forgot to see the specifier, it is 'iifi' it should be 'iifii'

Code:
#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifii>(more:playerid,more:damagedid,Float:amount,more:weaponid,end:bodypart)
__________________
iZN is offline   Reply With Quote
Old 17/01/2014, 09:58 AM   #8
dusk
High-roller
 
dusk's Avatar
 
Join Date: Jul 2008
Posts: 1,117
Reputation: 46
Default Re: [FIX] error 025: function heading differs from prototype

Code:
P:2("Hooks_OnPlayerGiveDamage called: %d, %d, %f, %d", playerid, damagedid, Float:amount, weaponid, bodypart);
Shouldn't there be one more placeholder for "bodypart"?
dusk is offline   Reply With Quote
Old 17/01/2014, 10:05 AM   #9
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Location: Poland
Posts: 1,947
Reputation: 185
Default Re: [FIX] error 025: function heading differs from prototype

Fixed all the missing parts, and specifiers. Download below.

http://sendupload.cba.pl/getfile.php?id=225
__________________
Have spent some great time of my life here since 0.1b version of SA-MP. I will never-ever forget the times I have had so much fun with people around here, during gameplay, scripting and being invented in so many SA-MP projects. Maybe I wasn't so active in FS/INC/GM sections to some of you and never have released that much but there's a reason behind it which isn't actually work mentioning. I am here to say goodbye to everyone and thanks for all the good times. TLoU (SA-MP) project shall never be finished because of me - but there's nothing we can do about it really. I think I am too old for all of it and same for the gaming (I guess) - I just can not let myself spend any more time in this addictive modification for GTA:SA. I have got something out of it and I respect it so much. Saying that I owe SA-MP my current job that I have is more than enough. There's not any certain steps that you have to take in order to achieve your goals.

Much love from Uncle Riddick and take care everyone
Riddick94 is offline   Reply With Quote
Old 17/01/2014, 07:53 PM   #10
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,536
Reputation: 2938
Default Re: [FIX] error 025: function heading differs from prototype

Thanks for fixing this, the part fixing the "P2" lines isn't required as they are just debug messages, but thanks anyway.
Y_Less is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 025: function heading differs from prototype radiobizza Scripting Help 17 18/05/2013 12:37 AM
error 025: function heading differs from prototype Cutt3r Scripting Help 1 02/04/2013 11:25 PM
error 025: function heading differs from prototype duuuwh PortuguÍs/Portuguese 8 03/10/2012 11:37 PM
error 025: function heading differs from prototype Beastlynoob Scripting Help 3 09/04/2012 01:15 PM
(425) : error 025: function heading differs from prototype Meinstad Help Archive 3 28/12/2010 08:23 AM


All times are GMT. The time now is 02:22 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.