SA-MP Forums Archive
Pawn compiler jokes me. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawn compiler jokes me. (/showthread.php?tid=510579)



Pawn compiler jokes me. - Galletziz - 01.05.2014

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    return 1
}
Код:
(1311) : error 025: function heading differs from prototype
why?!


Re: Pawn compiler jokes me. - Galletziz - 01.05.2014

I have read on a_samp include and this callback is included with all parameters so i don't know why the compiler return me this error.


Re: Pawn compiler jokes me. - Jstylezzz - 01.05.2014

Have you updated your SA-MP server package? (by which I mean the includes?) It looks like the compiler is using an outdated include, in which the syntax of OnPlayerTakeDamage was different.

EDIT: Are you sure that the compiler is using the a_samp.inc that you just checked?


Re: Pawn compiler jokes me. - Bingo - 01.05.2014

It's
pawn Код:
return 1;



Re: Pawn compiler jokes me. - Galletziz - 01.05.2014

Quote:
Originally Posted by Jstylezzz
Посмотреть сообщение
Have you updated your SA-MP server package? (by which I mean the includes?) It looks like the compiler is using an outdated include, in which the syntax of OnPlayerTakeDamage was different.

EDIT: Are you sure that the compiler is using the a_samp.inc that you just checked?
the server is the last, and i have all the includes in, and in a_samp.inc have the callback that i want use..


Re: Pawn compiler jokes me. - Galletziz - 01.05.2014

Quote:
Originally Posted by Bingo
Посмотреть сообщение
It's
pawn Код:
return 1;
it isn't.


Re: Pawn compiler jokes me. - Jstylezzz - 01.05.2014

Lol, yes it is. Bingo is right, it's
pawn Код:
return 1;
.


Re: Pawn compiler jokes me. - Galletziz - 01.05.2014

Quote:
Originally Posted by Jstylezzz
Посмотреть сообщение
Lol, yes it is. Bingo is right, it's
pawn Код:
return 1;
.
it isn't i tryed and compilter return the same error ._.


Re: Pawn compiler jokes me. - Jstylezzz - 01.05.2014

Yeah, but even if it returns the same error, it is return 1;
Take a look at the wiki
Now, I'm not sure what's causing your problem, as the function works perfectly fine for me. Just for the sake of trying, could it be that line 1311 is not the line you copy pasted?

To be sure, I downloaded a fresh sa-mp server package and added the code from the first post into a blank script (adding a ';' after return), and it compiles fine.


Re: Pawn compiler jokes me. - Galletziz - 01.05.2014

i have check it in another file .pwn, and compiler compile it perfectly, in my gm file not.. why ?! :O