AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved error 025: function heading differs from prototype (https://forums.alliedmods.net/showthread.php?t=314693)

SHIELD755 03-03-2019 05:54

error 025: function heading differs from prototype
 
any fix please
i dont know what happen. the code is working fine and i have compiled the code but when i recompile it i got error

Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Modified for www.freakz.ro

hero (2).sma(771) : error 025: function heading differs from prototype
hero (2).sma(779) : warning 217: loose indentation

1 Error.
Compile failed!


CODE:
PHP Code:

public pfn_touch(ptrptdattacker)
{
if (
pev_valid(ptr) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker]) // check valid entity and user has gun
    
{    
        
// Get classnames
        
static classname[32]
        
pev(ptrpev_classnameclassname31)
         
//Get owner
            
new owner pev(ptrpev_owner)
            
// Alive...
            
new FM_NULLENT
            
//Damage
                
if( a!=owner&& a!=ptr&&pev(a,pev_takedamage)!=DAMAGE_NO && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] ) 
                
ExecuteHamBHam_TakeDamage,owner ,ownerget_pcvar_floatcvar_damage_sentry ), DMG_BULLET )
                
set_pev(ptrpev_flagsFL_KILLME)
      }
      return 
PLUGIN_HANDLED



eat1k 03-03-2019 06:38

Re: error 025: function heading differs from prototype
 
Where is the complete error?

SHIELD755 03-03-2019 06:43

Re: error 025: function heading differs from prototype
 
Quote:

Originally Posted by eat1k (Post 2641715)
Where is the complete error?

pasted error !!!

eat1k 03-03-2019 06:58

Re: error 025: function heading differs from prototype
 
public pfn_touch(ptr, ptd, attacker)

Now open engine.inc and search pfn_touch.

SHIELD755 03-03-2019 07:21

Re: error 025: function heading differs from prototype
 
Quote:

Originally Posted by eat1k (Post 2641721)
public pfn_touch(ptr, ptd, attacker)

Now open engine.inc and search pfn_touch.

FIXED the promble is the "(ptr, ptd, attacker)" just removed "attacker" and compiled it work


All times are GMT -4. The time now is 14:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.