Block ESC
#6

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:
Код:
#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;
}
?
Reply


Messages In This Thread
Block ESC - by soueu - 26.12.2011, 22:27
Re: Block ESC - by PrawkC - 26.12.2011, 22:39
Re: Block ESC - by coole210 - 26.12.2011, 22:43
Re: Block ESC - by soueu - 26.12.2011, 22:55
Re: Block ESC - by coole210 - 26.12.2011, 23:22
Re: Block ESC - by soueu - 27.12.2011, 01:21
Re: Block ESC - by coole210 - 27.12.2011, 03:16
Re: Block ESC - by Scenario - 27.12.2011, 04:11
Re: Block ESC - by soueu - 27.12.2011, 05:54
Re: Block ESC - by Scenario - 27.12.2011, 16:23

Forum Jump:


Users browsing this thread: 1 Guest(s)