25% Chance to Headshot
#3

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.

PHP код:
if(bodypart == BODY_PART_HEAD)
{
    if(
weaponid == 34)
    {
        
rando random(4);
        switch(
rando)
        {
            case 
012:
            {
                return 
0;
            }
            case 
3:
            {
                
SetPlayerHealth(playerid0);
            }
        }
    }

Reply


Messages In This Thread
25% Chance to Headshot - by dionisak0s - 31.05.2015, 12:30
Re: 25% Chance to Headshot - by SoFahim - 31.05.2015, 12:58
Re: 25% Chance to Headshot - by Sellize - 31.05.2015, 13:05
Re: 25% Chance to Headshot - by dionisak0s - 31.05.2015, 23:00
Re: 25% Chance to Headshot - by SickAttack - 31.05.2015, 23:47
Re: 25% Chance to Headshot - by dionisak0s - 04.06.2015, 09:57

Forum Jump:


Users browsing this thread: 2 Guest(s)