28.12.2014, 02:07
I guess I'll just post this here since it's kinda small:
Basically gets called when a player drowns. It will also give the coordinates, along with the facing angle of the player when they died / drowned. You can prevent hacks / exploits I imagine by checking if it's in range of a body of water, etc.
pawn Код:
#include <a_samp>
#tryinclude <YSI\y_hook>
#if !defined hook
#define hook public
#endif
hook OnPlayerDeath(playerid, killerid, reason)
{
if(reason == WEAPON_DROWN)
{
if(killerid == playerid || killerid == INVALID_PLAYER_ID)
{
new Float: X, Float: Y, Float: Z, Float: fAngle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, fAngle);
CallLocalFunction("OnPlayerDrown", "iffff", playerid, X, Y, Z, fAngle);
return 1;
}
}
return true;
}
forward OnPlayerDrown(playerid, Float: dX, Float: dY, Float: dZ, Float: dAngle);