31.05.2015, 12:30
That's something that I added on OnPlayerTakeDamage, I want a headshot to be succesful with a sniper but with any other weapon it must have a 25% to success or else it will miss the shot, but it seems that one shot with a weapon kills the player.
Код:
new rando;
if(bodypart == BODY_PART_HEAD)
{
if(weaponid == 34)
{
SetPlayerHealth(playerid, 0);
}
else
{
rando = random(3);
switch(rando)
{
case 0, 1, 2:
{
return 0;
}
case 4:
{
SetPlayerHealth(playerid, 0);
}
}
}
}
if(bodypart == BODY_PART_RIGHT_ARM)
{
SetPlayerArmedWeapon(playerid, 0);
}


