27.12.2011, 01:21
(
Последний раз редактировалось soueu; 27.12.2011 в 01:58.
)
Hmm thanks for the tip.
Still not sure what would be the best way to detect the damage done from the attacker and then to apply it on the victim...
Would something like this work:
?
Still not sure what would be the best way to detect the damage done from the attacker and then to apply it on the victim...
Would something like this work:
Код:
#include <a_samp> new Float:AFKPos[MAX_PLAYERS][3]; public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { new Float:Pos[3]; new Float:health; for(new i = 0; i < MAX_PLAYERS; i++) { GetPlayerPos(i,Pos[0],Pos[1],Pos[2]); if(Pos[0] + Pos[1] + Pos[2] == AFKPos[i][0] + AFKPos[i][1] + AFKPos[i][2]) { if(amount > 0) { GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, health - amount); } } GetPlayerPos(i, AFKPos[i][0], AFKPos[i][1], AFKPos[i][2]); } return 1; }