public OnPlayerTakeDamage
#1

Ok, i'm sure i've probably posted too many help threads this past week, what was it? 3? =3

Anyways, i'm having an issue with OnPlayerTakeDamage. I'm basically using it so people won't be idiots, and it'd force them to actually take cover and maybe rp their shootouts (rp server =3). Anyways, with this, it makes the armor useless, so i've come up with something that would hopefully make it deduct the armor first, but instead it one hit kills, or just doesn't even work. Maybe one of you would have better luck solving that issue

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
	new Float:HP;
	new Float:AR;
	GetPlayerArmour(playerid,AR);
	if(PlayerInfo[playerid][pSArmour] >= 2)
	{
	    if(weaponid == 22) SetPlayerArmour(playerid, AR-50);
	    if(weaponid == 34) SetPlayerArmour(playerid, AR-200);
	    if(weaponid == 33) SetPlayerArmour(playerid, AR-100);
	    if(weaponid == 25) SetPlayerArmour(playerid, AR-70);
	    return 1;
	}
	else
	{
	    if(weaponid == 22) SetPlayerHealth(playerid, HP-50);
	    if(weaponid == 34) SetPlayerHealth(playerid, HP-200);
		if(weaponid == 33) SetPlayerHealth(playerid, HP-100);
		if(weaponid == 25) SetPlayerHealth(playerid, HP-70);
	}
	return 1;
}
Reply


Messages In This Thread
public OnPlayerTakeDamage - by Jay_Dixon - 30.04.2013, 18:28
Re: public OnPlayerTakeDamage - by Jay_Dixon - 30.04.2013, 19:01
Re: public OnPlayerTakeDamage - by Sanguy - 30.04.2013, 19:03

Forum Jump:


Users browsing this thread: 2 Guest(s)