SA-MP Forums Archive
Help: - 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: Help: (/showthread.php?tid=407310)



Help: function heading differs from prototype - jakejohnsonusa - 13.01.2013

I get "error 025: function heading differs from prototype" on the following code. Whats wrong? And how can I fix it?


Code: (Error on line OnPlayerTakeDamage)
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)//Called when a player takes damage
{
    new Float:hp;
    GetPlayerHealth(playerid, hp); //Get the player's health
    if(hp < 40.0) //If their health is lower than 40
    {
        if(Dying[playerid] == 0) //If they are not already dying (We don't want to set a timer twice)
        {
             SetTimerEx("DeathTimer", 3000, true, "i", playerid); //Set a timer every 3 seconds to go off (repeating)
             Dying[playerid] = 1; //They are now dying
             SendClientMessage(playerid, 0xFF0000FF, "You are injured and are losing health slowly. You need a medic!"); //Change this message however you want, or remove it, the choice is yours
        }
    }
    return 1;
}

Thanks in advance!


Re: Help: - TJKeeran - 13.01.2013

Is the server upgraded to 0.3e?


Re: Help: - jakejohnsonusa - 13.01.2013

Yes. It's upgrated to 0.3e.


Re: Help: - TJKeeran - 13.01.2013

On the error line, you need to add a space after the colon from "Float"

Ex;

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)


Re: Help: - jakejohnsonusa - 13.01.2013

Didn't work, same error.