Help with error 025?
#1

I get the error: error 025: function heading differs from prototype


I have been chaging my gamemode from this mysql plugin:https://sampforum.blast.hk/showthread.php?tid=7106

to this one: https://sampforum.blast.hk/showthread.php?tid=56564



The lines of code that are getting the error are:

Код:
forward strcount(const string[], delimiter);
Код:
public split(const strsrc[], strdest[][], delimiter)
{
	new i, li;
	new aNum;
	new len;
	while(i <= strlen(strsrc)){
		if(strsrc[i]==delimiter || i==strlen(strsrc)){
			len = strmid(strdest[aNum], strsrc, li, i, 128);
			strdest[aNum][len] = 0;
			li = i+1;
			aNum++;
		}
		i++;
	}
	return 1;
}


these errors happened after i changed all the code for the mysql.
Reply
#2

That means your forward is different to your public function (callback).

For example:
pawn Код:
forward OnPlayerDoSomething(playerid, reason);

public OnPlayerDoSomething(playerid, thereason) // "thereason" is not the same as "reason".
{
    return 1;
}
Reply
#3

Код:
public strcount(const string[], delimiter[])
{
	new i, count;
	while(i <= strlen(string)){
		if(string[i]==delimiter || i==strlen(string)){
			count++;
		}
		i++;
	}
	return count;
}
theres the public


btw i didnt get these erros until i changed all the code from the old mysql plugin... so does it have to do witht that?
Reply
#4

"delimiter" is not the same as "delimiter[]" (the second one is an array).

Solution:
pawn Код:
public strcount(const string[], delimiter) // Change delimiter by this one.
By the way, use [ pawn] [ /pawn] tags instead of [ code] [ /code], it looks much better!
Reply
#5

Your public:
pawn Код:
public split(const strsrc[], strdest[][], delimiter)
Your forward:
pawn Код:
forward split(const strsrc[], strdest[], delimiter)
See the difference? It has to do with strdest. One has [], the other has [][]. The public you have is correct. So your forward should be:
pawn Код:
forward split(const strsrc[], strdest[][], delimiter);
Reply
#6

The code mathces what you say yet it is still giving same errors, LISTEN!!!! the code is giving errors ONLY when the mysql stuff is changed.... When its samp_mysql_xxxx its fine but when i use gstylez i get those 2 errors mysql_xxxxx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)