Error 025
#1

I have the latest a_samp include.

PHP код:
error 025: function heading differs from prototype 
Here's the code.

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    new 
Float:HPholder[1000];
    
GetPlayerHealth(playeridHP);
    if(
weaponid == 4SetPlayerHealth(playeridHP-30);
    if(
weaponid == 22SetPlayerHealth(playeridHP-25);
    if(
weaponid == 32SetPlayerHealth(playeridHP-25);
    if(
weaponid == 28SetPlayerHealth(playeridHP-25);
    if(
weaponid == 30SetPlayerHealth(playeridHP-30);
    if(
weaponid == 31SetPlayerHealth(playeridHP-21);
    if(
weaponid == 34SetPlayerHealth(playeridHP-70);
    if(
weaponid == 29SetPlayerHealth(playeridHP-25);
    if(
weaponid == 25SetPlayerHealth(playeridHP-40);
     if(!
IsPlayerConnected(playerid)) return 0;
      if(!
IsPlayerConnected(issuerid)) return 0;
      
       if(
issuerid != INVALID_PLAYER_ID)
       {
           if(
weaponid == || weaponid == || weaponid == || weaponid == || weaponid == || weaponid == ||
            
weaponid == || weaponid == || weaponid == || weaponid == 15)
           {
               
sInfo[playerid][Misc] += 1;
        }
       }
      if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
       {
        
SetPlayerHealth(playerid0.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(playeridHP-70);
               
sInfo[playerid][Head] += 1;
        }
       }
    if(
issuerid != INVALID_PLAYER_ID)
    {
        
PlayerPlaySound(issuerid178020.00.00.0);
        new 
Float:hp,string[128];
        
GetPlayerHealth(playerid,hp);
        if(
hp amount 26 && Fell[playerid] == -1)
        {
            
Fell[playerid] = 1;
            
SetPlayerHealth(playerid,25.0);
            
playaDeath[playerid] = SetTimerEx("PlayersDeath",180000,false,"i",playerid);
            
TogglePlayerControllable(playerid0);
            
ClearAnimations(playerid);
            
ApplyAnimation(playerid,"CRACK""crckdeth2"4.010000);
            if(
sInfo[playerid][Misc] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d bruises on their body.\n"sInfo[playerid][Misc]);
                
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][Head] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n"sInfo[playerid][Head]);
                
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][Chest] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n"sInfo[playerid][Chest]);
                
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][Crotch] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n"sInfo[playerid][Crotch]);
                
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][LArm] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n"sInfo[playerid][LArm]);
                
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][RArm] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n"sInfo[playerid][RArm]);
                   
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][LLeg] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n"sInfo[playerid][LLeg]);
                   
strcat(holderstringsizeof(holder));
            }
            if(
sInfo[playerid][RLeg] > 0)
            {
                
format(stringsizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n"sInfo[playerid][RLeg]);
                
strcat(holderstringsizeof(holder));
               }
            
deathlabel[playerid] = Create3DTextLabel(holder, -1Deadx[playerid], Deady[playerid], Deadz[playerid], 10.000);
            return 
0;
        }
    }
    
GetPlayerArmour(playerid,PlayerInfo[playerid][pArmour]);
    if(
actmarker[issuerid] >= 1)
    {
        
TextDrawShowForPlayer(issueridHitMarker);
        
timarker SetTimerEx("HTD"250true"%d"issuerid);
        
PlayerPlaySound(issuerid,1057,0,0,0);
    }
    return 
1;

Reply
#2

Errors Line
Reply
#3

It is a code issue. I have no idea where but searches on that error, return half readable threads.

What I see though is this...

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) 
{ 
    new Float:HP, holder[1000]; 
    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(!IsPlayerConnected(playerid)) return 0; 
      if(!IsPlayerConnected(issuerid)) return 0;
You set the players health, then check if they are connected.

You need to read your code a bit more. As was said above though, the full error, and highlighting of what line it occurs, is much appreciated.
Reply
#4

PHP код:
error 025: function heading differs from prototype 
Happens on

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart
Reply
#5

Quote:
Originally Posted by ChromeAmazing
Посмотреть сообщение
PHP код:
error 025: function heading differs from prototype 
Happens on

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart
Searching the error, and the callback returned a few hits.

https://sampforum.blast.hk/showthread.php?tid=488088

Says you may be using YSI.

https://sampforum.blast.hk/showthread.php?tid=488198

Maybe a fix in there. just be weary and keep track of what changes you make to try fix it.
Reply
#6

use my impl.inc include it will fix it for you http://s000.tinyupload.com/?file_id=...77299110<br />
i also had these errors on the same lines but i fixed my include so it may work for you too copy them to your include/ysi folder
Reply
#7

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
use my impl.inc include it will fix it for you http://s000.tinyupload.com/?file_id=...77299110<br />
i also had these errors on the same lines but i fixed my include so it may work for you too copy them to your include/ysi folder
That doesn't teach anything... To be shown where and why the issues occur is better than simply pasting up a "fix".
Reply
#8

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
That doesn't teach anything... To be shown where and why the issues occur is better than simply pasting up a "fix".
That would help me greatly, and I would prefer to actually be told what I did wrong or what is wrong.
Reply
#9

Quote:
Originally Posted by ChromeAmazing
Посмотреть сообщение
That would help me greatly, and I would prefer to actually be told what I did wrong or what is wrong.
If you read what was linked to you, then you'd know already.

The order of the return from the function is different to what is being handed to it.

In this case, the order of the callback, differs from YSIs version.



Again, if you had read through what was linked to you, you'd know that... A "fix" is also in there, in instructions, on how to fix that issue.
Reply
#10

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
If you read what was linked to you, then you'd know already.

The order of the return from the function is different to what is being handed to it.

In this case, the order of the callback, differs from YSIs version.



Again, if you had read through what was linked to you, you'd know that... A "fix" is also in there, in instructions, on how to fix that issue.
people having common sense will understand that u dont need to say it loud

OT:the problem was not yours its an updated params and ur include was not that updated so when i had these issue i updated it my self
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)