#1

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!
Reply
#2

Is the server upgraded to 0.3e?
Reply
#3

Yes. It's upgrated to 0.3e.
Reply
#4

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

Ex;

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
Reply
#5

Didn't work, same error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)