How to fix this error?
#1

How to fix this error? Thanks in advance !

Код:
error 025: function heading differs from prototype
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
  if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
    {
	if(PlayerInfo[playerid][pIsDeath] == 1)
	{
 	 new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 24) SetPlayerHealth(playerid, HP-46);//DesertEagle
    if(weaponid == 22) SetPlayerHealth(playerid, HP-13);//Colt45
    if(weaponid == 32) SetPlayerHealth(playerid, HP-7);//Tec9
    if(weaponid == 28) SetPlayerHealth(playerid, HP-7);//Uzi
    if(weaponid == 23) SetPlayerHealth(playerid, HP-13);//SilencedColt
    if(weaponid == 31) SetPlayerHealth(playerid, HP-10);//M4
    if(weaponid == 30) SetPlayerHealth(playerid, HP-10);//AK
    if(weaponid == 29) SetPlayerHealth(playerid, HP-8);//MP5
    if(weaponid == 34) SetPlayerHealth(playerid, HP-41);//SniperRifle
    if(weaponid == 33) SetPlayerHealth(playerid, HP-25);//CuntGun
    if(weaponid == 25) SetPlayerHealth(playerid, HP-30);//PumpShotgun
    if(weaponid == 27) SetPlayerHealth(playerid, HP-40);//Spaz12
	}
}
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
  if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
    {
    if(PlayerInfo[playerid][pIsDeath] == 1)
        {
        new Float:HP;
        GetPlayerHealth(playerid, HP);
        if(weaponid == 24) SetPlayerHealth(playerid, HP-46);//DesertEagle
        if(weaponid == 22) SetPlayerHealth(playerid, HP-13);//Colt45
        if(weaponid == 32) SetPlayerHealth(playerid, HP-7);//Tec9
        if(weaponid == 28) SetPlayerHealth(playerid, HP-7);//Uzi
        if(weaponid == 23) SetPlayerHealth(playerid, HP-13);//SilencedColt
        if(weaponid == 31) SetPlayerHealth(playerid, HP-10);//M4
        if(weaponid == 30) SetPlayerHealth(playerid, HP-10);//AK
        if(weaponid == 29) SetPlayerHealth(playerid, HP-8);//MP5
        if(weaponid == 34) SetPlayerHealth(playerid, HP-41);//SniperRifle
        if(weaponid == 33) SetPlayerHealth(playerid, HP-25);//CuntGun
        if(weaponid == 25) SetPlayerHealth(playerid, HP-30);//PumpShotgun
        if(weaponid == 27) SetPlayerHealth(playerid, HP-40);//Spaz12
        }
    }
    return 1;
}
Looks neater to me..
Reply
#3

How can I fix it?
Reply
#4

Which line it's the error ?

Edit:

You should check the forward for that function.
Reply
#5

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
    {
        if(PlayerInfo[playerid][pIsDeath] == 1)
        {
        new Float:HP;
        GetPlayerHealth(playerid, HP);
        if(weaponid == 24) SetPlayerHealth(playerid, HP-46);//DesertEagle
        if(weaponid == 22) SetPlayerHealth(playerid, HP-13);//Colt45
        if(weaponid == 32) SetPlayerHealth(playerid, HP-7);//Tec9
        if(weaponid == 28) SetPlayerHealth(playerid, HP-7);//Uzi
        if(weaponid == 23) SetPlayerHealth(playerid, HP-13);//SilencedColt
        if(weaponid == 31) SetPlayerHealth(playerid, HP-10);//M4
        if(weaponid == 30) SetPlayerHealth(playerid, HP-10);//AK
        if(weaponid == 29) SetPlayerHealth(playerid, HP-8);//MP5
        if(weaponid == 34) SetPlayerHealth(playerid, HP-41);//SniperRifle
        if(weaponid == 33) SetPlayerHealth(playerid, HP-25);//CuntGun
        if(weaponid == 25) SetPlayerHealth(playerid, HP-30);//PumpShotgun
        if(weaponid == 27) SetPlayerHealth(playerid, HP-40);//Spaz12
        }
    }
    return 1;
}
Try that, it's all i can think of.

Did you forward the function? If so, please show it.
Reply
#6

"bodypart" parameter has been added in 0.3z so the a_samp.inc file you try to compile the script with is for older versions. Update the server package (executables and includes) and re-compile.
Reply
#7

Fixed it by removing the bodypart, thanks for helping out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)