Making headshot Dis/able cmd
#2

Код:
new bool:HeadShots;
CMD:headshot(playerid, params[])
{
	//isplayeradmin(here)
	{
		if(HeadShots == false)
		{
			SendClientMessage(playerid, COLOR, "You have enabled headshots");
			HeadShots = true;
		}
		else
		{
			HeadShots = false;
			SendClientMessage(playerid, COLOR, "You have disabled headshots");
		}
	}
	return 1;
}
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && bodypart == 9 && HeadShots == true) 
    {
        // One shot to the head to kill
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Reply


Messages In This Thread
Making headshot Dis/able cmd - by SyCHO - 15.12.2015, 17:45
Re: Making headshot Dis/able cmd - by SnG.Scot_MisCuDI - 15.12.2015, 18:12
Re: Making headshot Dis/able cmd - by SyCHO - 15.12.2015, 19:14
Re: Making headshot Dis/able cmd - by SyCHO - 16.12.2015, 19:36
Re: Making headshot Dis/able cmd - by SyCHO - 20.12.2015, 20:29
Re: Making headshot Dis/able cmd - by SaltySandy - 20.12.2015, 20:36

Forum Jump:


Users browsing this thread: 1 Guest(s)