PDA

View Full Version : OnPlayerTakeDamage


Man43
16/04/2017, 11:58 AM
I Got an error i dont know what's wrong there... please help

error 025: function heading differs from prototype

Here my code

public OnPlayerTakeDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(Tazer[playerid] == 1 && GetPlayerWeapon(playerid) == TAZE_WEAPON)
{
new Float:health,losehp;
GetPlayerHealth(damagedid,health);
losehp = TAZE_LOSEHP;
if(Tazed[damagedid] == 1) return 1;
new Float:x, Float:y, Float:z;
GetPlayerPos(damagedid, x, y, z);
ClearAnimations(damagedid);
ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);
Spark[damagedid] = CreateObject(TAZE_SPARK, x, y, z-3, 0, 0, 0);
SetTimerEx("DestroySpark", TAZE_DESTROY, 0, "i", damagedid);
SetTimerEx("TazedRemove", TAZE_TIMER, 0, "i", damagedid);
//TogglePlayerControllable(damagedid, 0);
Tazed[damagedid] = 1;
if(losehp) {} else SetPlayerHealth(damagedid, health+amount);
}
return 1;
}

J0sh...
16/04/2017, 11:59 AM
update your includes.

Man43
16/04/2017, 12:01 PM
which includes?!

ISmokezU
16/04/2017, 12:23 PM
It's

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

VoltMeter
16/04/2017, 01:50 PM
It's

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

Exactly.