01.07.2020, 14:23
ALS hook SetPlayerHealth/Armour, GetPlayerHealth/Armour, and under OnPlayerTakeDamage do the thing.
Example:
Example:
PHP Code:
SetPlayerArmourEx( playerid, Float:armour ) {
PlayerInfo[ playerid ] [ pArmor ] = armour;
return SetPlayerArmour( playerid, PlayerInfo[ playerid ] [ pArmor ] );
}
GetPlayerArmourEx( playerid, &Float:armour ) {
return PlayerInfo[ playerid ] [ pArmor ];
}
#if defined _ALS_SetPlayerHealth
#undef SetPlayerArmour
#else
#define _ALS_SetPlayerArmour
#endif
#define SetPlayerArmour SetPlayerArmourEx
#if defined _ALS_GetPlayerArmour
#undef GetPlayerArmour
#else
#define _ALS_GetPlayerArmour
#endif
#define GetPlayerArmour GetPlayerArmourEx