27.12.2016, 19:09
Hello, I'm making a Taser system and I have some questions.
How I can make that the Taser Weapon (currently silenced pistol) don't take health to player?
I don't want to add the amount to his health because when a player has, for example, 10hp he'll die inmediately and will be a little buggy. Here's my actual code:
How I can make that the Taser Weapon (currently silenced pistol) don't take health to player?
I don't want to add the amount to his health because when a player has, for example, 10hp he'll die inmediately and will be a little buggy. Here's my actual code:
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(PlayerInfo[issuerid][pFaction] == 1 && PD_Taser[issuerid] == 1 && weaponid == 23)
{
if(Paralized[playerid] == 0)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+amount);
ApplyAnimation(playerid, "SWEET", "LaFin_Sweet", 4.1, 0, 1, 1, 1, 0);
TogglePlayerControllable(playerid, 0);
Paralized[playerid] = 1;
SetTimerEx("Tazz", 10000, false, "i", playerid);
}
}
return 1;
}


