public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) { if (playerid != INVALID_PLAYER_ID && damagedid != INVALID_PLAYER_ID) { if (weaponid == 23 && TazerHand[playerid] == 1) { if(ReloadingTazer[playerid] > 0) { SCM(playerid, TOMATO, " (info) {FFFFFF}Reloading!"); return 1; } if(!PlayerTazed[damagedid]) { new string[128]; PlayerPlaySoundInArea(playerid, 6003); PlayerTazed[damagedid] = 1; TogglePlayerControllable(damagedid, 0); TazerTimer[damagedid] = 10; for (new i = 0; i < 3; i ++) { ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0); } ReloadingTazer[playerid] = 1; } } } return 1; }
You can, Add Get Player health on top of OnPlayerGiveDamage and Add Setplayerhealth after if (weaponid == 23 && TazerHand[playerid] == 1)
|
You can, Add Get Player health on top of OnPlayerGiveDamage and Add Setplayerhealth after if (weaponid == 23 && TazerHand[playerid] == 1)
|
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if (playerid != INVALID_PLAYER_ID && damagedid != INVALID_PLAYER_ID)
{
if (weaponid == 23 && TazerHand[playerid] == 1)
{
new Float:health;
GetPlayerHealth(damagedid, health);
if(ReloadingTazer[playerid] > 0)
{
SCM(playerid, TOMATO, " (info) {FFFFFF}Reloading!");
return 1;
}
if(!PlayerTazed[damagedid])
{
new string[128];
SetPlayerHealth(damagedid, health);
PlayerPlaySoundInArea(playerid, 6003);
PlayerTazed[damagedid] = 1;
TogglePlayerControllable(damagedid, 0);
TazerTimer[damagedid] = 10;
for (new i = 0; i < 3; i ++)
{
ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
}
ReloadingTazer[playerid] = 1;
}
}
}
return 1;
}