Hook giving "function heading differs from prototype"
#1

I just downloaded and included Nex Anticheater. But it triggered two errors that i couldn't figure:

Код:
C:\PawnCC\include\nex-ac.inc(3061) : warning 202: number of arguments does not match definition
C:\PawnCC\include\nex-ac.inc(3075) : error 025: function heading differs from prototype
C:\PawnCC\include\nex-ac.inc(5678) : warning 202: number of arguments does not match definition
C:\PawnCC\include\nex-ac.inc(5692) : error 025: function heading differs from prototype
This error is usually caused by a missing parameter, but this is the code:

PHP код:
#if defined _inc_y_hooks || defined _INC_y_hooks
    
hook OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
#else
    
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
#endif
{
    if(
ACInfo[playerid][acKicked]) return 1;
    
ACInfo[playerid][acDeathRes] = true;
    
#if !defined _inc_y_hooks && !defined _INC_y_hooks && defined ac_OnPlayerTakeDamage
        
L3061 --> return ac_OnPlayerTakeDamage(playeridissueridamountweaponidbodypart);
    
#else
        
return 0;
    
#endif
}
//The Hook itself
#if !defined _inc_y_hooks && !defined _INC_y_hooks
    #if defined _ALS_OnPlayerTakeDamage
        #undef OnPlayerTakeDamage
    #else
        #define _ALS_OnPlayerTakeDamage
    #endif
    #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
    #if defined ac_OnPlayerTakeDamage
        
L3075 --> forward ac_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart);
    
#endif
#endif 
The other snippet is very similar.

Does anyone has any ideia of what is going on?
Reply
#2

change line 3061 to

PHP код:
ac_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart); 
I dont see the other line with errors could you like make them bold or something cause your coding is a bit untidy and confusing
Reply
#3

I edited the topic, hope it's better now

I changed to your solution, but it didn't work!

PS: When I compile only the include, it doesn't give any errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)