[Help]How to fix error 025 function heading differs from prototype
#1

D:\gta edit\gamemode\SanJoseRolePlay.pwn(705 : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(7101) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(8080) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(8120) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(8159) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(1120 : warning 204: symbol is assigned a value that is never used: "stattext"
D:\gta edit\gamemode\SanJoseRolePlay.pwn(12954) : error 025: function heading differs from prototype
D:\gta edit\gamemode\SanJoseRolePlay.pwn(19874) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(19882) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(19890) : warning 213: tag mismatch
D:\gta edit\gamemode\SanJoseRolePlay.pwn(25537) : warning 203: symbol is never used: "Name"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
Reply
#2

Update your includes because OnPlayerTakeDamage is forwarded without the "bodypart" parameter which was added in 0.3z version.

About the tag mismatch warnings, in case you cannot fix them then post the code from those lines.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Update your includes because OnPlayerTakeDamage is forwarded without the "bodypart" parameter which was added in 0.3z version.

About the tag mismatch warnings, in case you cannot fix them then post the code from those lines.
How To Fix
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 4) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 22) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 32) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 28) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 30) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 31) SetPlayerHealth(playerid, HP-21);
    if(weaponid == 34) SetPlayerHealth(playerid, HP-70);
    if(weaponid == 29) SetPlayerHealth(playerid, HP-25);

    if(weaponid == 25) SetPlayerHealth(playerid, HP-40);
    if(issuerid != INVALID_PLAYER_ID)
   	{
   	    if(weaponid == 0 || weaponid == 1 || weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 ||
		    weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 15)
   	    {
   			sInfo[playerid][Misc] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
   	{
		SetPlayerHealth(playerid, 0.0);
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 3)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][Chest] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 4)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][Crotch] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 5)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][LArm] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 6)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][RArm] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 7)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][LLeg] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 8)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][RLeg] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 9)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   	    	SetPlayerHealth(playerid, HP-70);
   			sInfo[playerid][Head] += 1;
		}
   	}
    return 1;
}
Reply
#4

Help Me please
Reply
#5

Do everyone (including yourself) a favor and learn how to not code terrily, read some tutorials (you had tons of redundant code, used if only instead of if-else / switch and you had no proper indentation, math mistakes (integer + float, works but is slower))

PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    new 
Float:HP;
    
GetPlayerHealth(playerid, HP);
    switch(
weaponid)
    {
        case 
4: SetPlayerHealth(playerid, HP-30.0);
        case 
22: SetPlayerHealth(playerid, HP-25.0);
        case 
32: SetPlayerHealth(playerid, HP-25.0);
        case 
28: SetPlayerHealth(playerid, HP-25.0);
        case 
30: SetPlayerHealth(playerid, HP-30.0);
        case 
31: SetPlayerHealth(playerid, HP-21.0);
        case 
34: SetPlayerHealth(playerid, HP-70.0);
        case 
29: SetPlayerHealth(playerid, HP-25.0);
        case 
25: SetPlayerHealth(playerid, HP-40.0);    
    }
    if(
isseruid != INVALID_PLAYER_ID)
    {
        if(
isValidWeaponForSpecialHit(weaponid))
        {
            switch(
bodypart)
            {
                case 
3: sInfo[playerid][Chest] += 1;
                case 
4: sInfo[playerid][Crotch] += 1;
                case 
5: sInfo[playerid][LArm] += 1;
                case 
6: sInfo[playerid][RArm] += 1;
                case 
7: sInfo[playerid][LLeg] += 1;
                case 
8: sInfo[playerid][RLeg] += 1;
                case 
9:
                {
                    
SetPlayerHealth(playerid, HP-70.0);
                    
sInfo[playerid][Head] += 1;
                }
            }
        }
    }
}
isValidWeaponForSpecialHit(weaponid)
{
    return (
weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34);
} 
Also, update your a_samp.inc which you can find in the package at http://www.sa-mp.com/download.php
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)