SA-MP Forums Archive
Problem with OnPlayerTakeDamage - 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: Problem with OnPlayerTakeDamage (/showthread.php?tid=510992)



Problem with OnPlayerTakeDamage - Syncro - 03.05.2014

Code:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(weaponid == 0 && GetPVarInt(issuerid, "Tazer") == 1)
	{
	    SetPlayerHealth(playerid, GetPlayerHealth(playerid) - 10);
	    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 0, 0, 1, 30000, 1);
		return 1;
	)
}
I have a error with that code: "function differs from prototype".
I tryed:
- Download SA-MP Includes for 0.3z (not solved)
- Download YSI for 0.3z RC5 (not solved)
- Download YSI for 0.3z RC4 (not solved)
- Manually replace all the codes for fix in YSI files (not solved).

I need help please guys


Re: Problem with OnPlayerTakeDamage - iZN - 03.05.2014

Are you sure other includes are updated too? Open them and see if they've the older version of that callback.


Re: Problem with OnPlayerTakeDamage - Syncro - 03.05.2014

Yes, all includes are updated, i've readed online that is for YSI, but I've updated YSI!


Re: Problem with OnPlayerTakeDamage - Basssiiie - 03.05.2014

Why are you forwarding a native callback? You don't have to do that.


Re: Problem with OnPlayerTakeDamage - Syncro - 03.05.2014

Ok but the function with or without the forward not function, please help me!


Re: Problem with OnPlayerTakeDamage - brent94 - 03.05.2014

Mind taking a screenshot of the compiler window, with the error, and uploading it for us?


Re: Problem with OnPlayerTakeDamage - Syncro - 04.05.2014

Ok, look

With OnPlayerTakeDamage and Script:


With OnPlayerTakeDamage but without the internal script!


It running! The warning is mine, i can remove it! Why with the internal script it release many errors?


Re: Problem with OnPlayerTakeDamage - [WSF]ThA_Devil - 04.05.2014

You have ) instead of } for bracket...
after first return 1; in OnPlayerTakeDamage


Re: Problem with OnPlayerTakeDamage - Galletziz - 04.05.2014

delete bodypart and it works.. but you can't use this parameter in this callback in future while you don't fix it.


Re: Problem with OnPlayerTakeDamage - Syncro - 04.05.2014

Quote:
Originally Posted by [WSF]ThA_Devil
View Post
You have ) instead of } for bracket...
after first return 1; in OnPlayerTakeDamage
What? Can you write the correct script for me? I'm italian and I can't speak you! Re-write the script please