public OnPlayerUpdate(playerid)
{
// code..
#if defined HC_OnPlayerUpdate
return HC_OnPlayerUpdate(playerid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerUpdate
#undef OnPlayerUpdate
#else
#define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate HC_OnPlayerUpdate
#if defined HC_OnPlayerUpdate
forward HC_OnPlayerUpdate(playerid);
#endif
remove it from either of them.
I recommend to remove it from include |
/* =============================
Limex's Swimming Include
Made by Limex / A
New function:
IsPlayerSwimming(playerid)
New callbacks:
OnPlayerStartSwimming(playerid)
OnPlayerStopSwimming(playerid)
Enjoy!
============================= */
#include <a_samp>
#if defined _ALS_OnPlayerUpdate
#undef OnPlayerUpdate
#else
#define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate HC_OnPlayerUpdate
#if defined HC_OnPlayerUpdate
forward HC_OnPlayerUpdate(playerid);
#endif
new bool:swimming[MAX_PLAYERS];
forward OnPlayerStartSwimming(playerid);
forward OnPlayerStopSwimming(playerid);
forward IsPlayerSwimming(playerid);
#define PUBLIC:%0(%1) forward %0(%1); \
public %0(%1)
public IsPlayerSwimming(playerid)
{
if(swimming[playerid]) return 1;
return 0;
}
PUBLIC:OnPlayerUpdate(playerid)
{
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strcmp(animlib, "SWIM", true) == 0 && !swimming[playerid])
{
swimming[playerid] = true;
OnPlayerStartSwimming(playerid);
}
else if(strcmp(animlib, "SWIM", true) != 0 && swimming[playerid] && strfind(animname, "jump", true) == -1)
{
swimming[playerid] = false;
OnPlayerStopSwimming(playerid);
}
}
else if(swimming[playerid])
{
swimming[playerid] = false;
OnPlayerStopSwimming(playerid);
}
#if defined HC_OnPlayerUpdate
return HC_OnPlayerUpdate(playerid);
#else
return 1;
#endif
}