Problem with OnPlayerTakeDamage
#1

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

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

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

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

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

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

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?
Reply
#8

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)