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: OnPlayerTakeDamage (
/showthread.php?tid=495112)
OnPlayerTakeDamage -
DarkLored - 16.02.2014
Hello so i made a one shot headshot with a sniper in OnPlayerTakeDamage callback
but it seems that i have a error
here is my code
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
PlayAudioStreamForPlayer(issuerid,"http://audioformat.com/download/headshot.mp3");
}
return 1;
}
Here is the error
pawn Код:
TDMv1.0.pwn(789) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Re: OnPlayerTakeDamage -
DarkLored - 16.02.2014
And i have the full version of 0.3z i just forgot that this sections if for RC versions
Any help guys i dont know whats the problem and i have the updated version
Re: OnPlayerTakeDamage -
Lordzy - 16.02.2014
You must be having the latest 0.3z include, make sure that the 'pawno.exe' application is being opened from the location where it got 3z includes. Or,
pawn Код:
//before onplayertakedamage
#if defined OnPlayerTakeDamage
#undef OnPlayerTakeDamage
#endif
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
PlayAudioStreamForPlayer(issuerid,"http://audioformat.com/download/headshot.mp3");
}
return 1;
}
Re: OnPlayerTakeDamage -
DarkLored - 16.02.2014
But when i compile it says that i have this symbol defined already and i have the latest samp server version i have downloaded the offical release of the full version and i get this problem and i cant use pawn i am using Notpad++ because of a problem that pawno launches the game after compiling
Re: OnPlayerTakeDamage -
DarkLored - 16.02.2014
Ah can i get any help guys?
I dont know why i get this problem i even checked a_samp.inc to check if its there and it is with the body part thing
Re: OnPlayerTakeDamage -
Lordzy - 16.02.2014
Are you sure that it's having problems with your script or any other includes? Because if you're using any libraries before the 0.3z release, you must update them too as if they might collide with the older versions.
Re: OnPlayerTakeDamage -
DarkLored - 16.02.2014
I have updated all the server files even server.cfg and anti lag shoot works but the OnPlayerTakeDamage isnt everything works except that
Re: OnPlayerTakeDamage -
burnuk - 16.02.2014
check all the includes you used... maybe one of them is using OnPlayerTakeDamage update the callback.
Re: OnPlayerTakeDamage -
iJumbo - 17.02.2014
You need to update YSI by ******