SA-MP Forums Archive
having trouble with OnPlayerGiveDamage - 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: having trouble with OnPlayerGiveDamage (/showthread.php?tid=489134)



having trouble with OnPlayerGiveDamage - [FAT]Klabauter[LST] - 20.01.2014

I keep getting this - error 025: function heading differs from prototype

I don't understand... i tried copy pasting it from the sticky topic that Kalcor made, then i tried copy pasting right from a_samp, then i downloaded the server again onto a different drive to make sure i was using the correct pawno... still the same error.

here's the callback that i'm trying to compile:
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
bodypart == BODY_PART_HEAD)
    {
        
SendClientMessage(playeridgreen"HEADSHOT");
    }
    if(
busy[playerid] == && gTeam[playerid] == gTeam[damagedid] && GetPlayerWeapon(playerid) == 41)
    {
        
healer(damagedid);
    }
    else if(
busy[playerid] == && gTeam[playerid] == gTeam[damagedid])
    {
        
SendClientMessage(playeridred"WATCH YOUR FIRE");
    }
    if(
exammo[playerid] == && gTeam[playerid] != gTeam[damagedid])
    {
        
incindiary(damagedid);
    }
    if(
GetPlayerWeapon(playerid) == 23 && gTeam[playerid] != gTeam[damagedid])
    {
        
panic(damagedid);
    }
    return 
1;

I just put that headshot message to test if the bodypart thing will work, before I added the "bodypart" param to the callback it was compiling with no errors or warnings. Is anyone else having this problem or am I just an idiot somehow?


Re: having trouble with OnPlayerGiveDamage - Riddick94 - 20.01.2014

Are you using YSI? If so:
https://sampforum.blast.hk/showthread.php?tid=488198


Re: having trouble with OnPlayerGiveDamage - [FAT]Klabauter[LST] - 20.01.2014

thanks a lot man, works