SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/12/2016, 08:42 AM   #1
superbboy78
Little Clucker
 
Join Date: Nov 2015
Posts: 10
Reputation: 0
Default [Help]How to fix error 025 function heading differs from prototype

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 (c) 1997-2006, ITB CompuPhase

Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
superbboy78 is offline   Reply With Quote
Old 27/12/2016, 09:28 AM   #2
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,863
Reputation: 1394
Default Re: [Help]How to fix error 025 function heading differs from prototype

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.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/12/2016, 02:54 AM   #3
superbboy78
Little Clucker
 
Join Date: Nov 2015
Posts: 10
Reputation: 0
Default Re: [Help]How to fix error 025 function heading differs from prototype

Quote:
Originally Posted by Konstantinos View Post
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
Code:
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;
}
superbboy78 is offline   Reply With Quote
Old 29/12/2016, 07:07 AM   #4
superbboy78
Little Clucker
 
Join Date: Nov 2015
Posts: 10
Reputation: 0
Default Re: [Help]How to fix error 025 function heading differs from prototype

Help Me please
superbboy78 is offline   Reply With Quote
Old 29/12/2016, 08:58 AM   #5
BiosMarcel
Banned
 
Join Date: Jul 2012
Location: Germany
Posts: 1,226
Reputation: 234
Default Re: [Help]How to fix error 025 function heading differs from prototype

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 Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    new 
Float:HP;
    
GetPlayerHealth(playeridHP);

    switch(
weaponid)
    {
        case 
4SetPlayerHealth(playeridHP-30.0);
        case 
22SetPlayerHealth(playeridHP-25.0);
        case 
32SetPlayerHealth(playeridHP-25.0);
        case 
28SetPlayerHealth(playeridHP-25.0);
        case 
30SetPlayerHealth(playeridHP-30.0);
        case 
31SetPlayerHealth(playeridHP-21.0);
        case 
34SetPlayerHealth(playeridHP-70.0);
        case 
29SetPlayerHealth(playeridHP-25.0);
        case 
25SetPlayerHealth(playeridHP-40.0);    
    }

    if(
isseruid != INVALID_PLAYER_ID)
    {
        if(
isValidWeaponForSpecialHit(weaponid))
        {
            switch(
bodypart)
            {
                case 
3sInfo[playerid][Chest] += 1;
                case 
4sInfo[playerid][Crotch] += 1;
                case 
5sInfo[playerid][LArm] += 1;
                case 
6sInfo[playerid][RArm] += 1;
                case 
7sInfo[playerid][LLeg] += 1;
                case 
8sInfo[playerid][RLeg] += 1;
                case 
9:
                {
                    
SetPlayerHealth(playeridHP-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
BiosMarcel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 025: function heading differs from prototype Shaktimaan Scripting Help 4 09/07/2015 08:50 AM
[HELP] error 025: function heading differs from prototype KingPersona Scripting Help 4 05/04/2015 11:44 AM
error 025: function heading differs from prototype Drago987 Scripting Help 5 06/03/2014 09:41 PM
[REQ-HELP] error 025: function heading differs from prototype Vythrin Scripting Help 4 20/02/2013 08:07 PM
(425) : error 025: function heading differs from prototype Meinstad Help Archive 3 28/12/2010 07:23 AM


All times are GMT. The time now is 03:22 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.