29.06.2014, 16:38
I'm making my anti-cheat, however, the health and armour doesn't "decrease" in the OnPlayerTakeDamage.
As you can see I've tried debugging to see if it works, though that doesn't even print.
Note that the "SetArmour" and "SetHealth" are apart of my anticheat.
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { printf("Armour amount: %d", PlayerInfo[playerid][Armour]); if(PlayerInfo[playerid][Armour] >= 1) { PlayerInfo[playerid][Armour] -= amount; printf("(A)Amount taken: %f", amount); SetArmour(playerid, PlayerInfo[playerid][Armour]); printf("New armour: %f", PlayerInfo[playerid][Armour]); if(PlayerInfo[playerid][Armour] == 1) { SetArmour(playerid, 0); } } if(PlayerInfo[playerid][Health] >= 1) { PlayerInfo[playerid][Health] -= amount; printf("(H)Amount taken: %f", amount); SetHealth(playerid, PlayerInfo[playerid][Health]); printf("New Health: %f", PlayerInfo[playerid][Health]); if(PlayerInfo[playerid][Health] == 1) { SetHealth(playerid, 0); } } return 1; }
Note that the "SetArmour" and "SetHealth" are apart of my anticheat.