• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Default Open.MP server return compiler error on default samp public callbacks.
#1
Exclamation 
Hello everyone! I installed the latest release of the OpenMP server. And when I tried to compile blank gamemode to just see how it all works, it give me the error on Default SAMP functions like, OnPlayerDeath and etc. Because as I understand they are already defined somewhere in `open.mp` include.

Error is: error 025: function heading differs from prototype

[Image: image.png?ex=65bbf63d&is=65a9813d&hm=f4c...height=564]

This error get fired up when I call default `public OnPlayerDeath`, and I don't know what to do, I really need this callback. 

I hope you will help me.
  Reply
#2
Quick Update:
I read about YSI, and turns out I had to use OnPlayerDeath as OnPlayerDeathEx, not sure if this is correct or not, I did not test it yet.
Here is the current code: 

Code:
forward OnPlayerDeathEx(playerid, killerid, reason);
public OnPlayerDeathEx(playerid, killerid, reason)
{
  UpdatePlayerDeaths(playerid);
  UpdatePlayerKills(killerid);
  return 1;
}
  Reply
#3
Nope, was not like this. I found this cool github link to all open.mp issues.
Here is the updated, code.
Code:
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
   UpdatePlayerDeaths(playerid);
   UpdatePlayerKills(killerid);
   return 1;
}

Problem was that I was not specifying the WEAPON type.
  Reply
#4
Good, you figured that out
  Reply


Forum Jump: