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: United States of we're fucked
Posts: 148
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:
pawn Code:
#define ALS_DO_PlayerTakeDamage<%0> %0<PlayerTakeDamage,iifi>(more:playerid,more:issuerid,Float:amount,end:weaponid)

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

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

Change to:
pawn 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:
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)

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

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

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

Find:
pawn 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:
pawn 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:
pawn Code:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)

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

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

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

Find:
pawn 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:
pawn 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: United States of we're fucked
Posts: 148
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

pawn 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: 528
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: United States of we're fucked
Posts: 148
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: 528
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!

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

should be

pawn 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
Posts: 2,444
Reputation: 569
Default Re: [FIX] error 025: function heading differs from prototype

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

pawn 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,114
Reputation: 46
Default Re: [FIX] error 025: function heading differs from prototype

pawn 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,923
Reputation: 214
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
__________________


Riddick94 is offline   Reply With Quote
Old 17/01/2014, 07:53 PM   #10
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,223
Reputation: 3183
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 07:22 AM.


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