31.05.2015, 13:05
random(3) can be 0,1,2 (three options)
You need to use random(4), which can be 0,1,2,3 (four options)
Also, fixed your code.
You need to use random(4), which can be 0,1,2,3 (four options)
Also, fixed your code.
PHP код:
if(bodypart == BODY_PART_HEAD)
{
if(weaponid == 34)
{
rando = random(4);
switch(rando)
{
case 0, 1, 2:
{
return 0;
}
case 3:
{
SetPlayerHealth(playerid, 0);
}
}
}
}