Making headshot Dis/able cmd
#1

Well, my script actually doesn't only containt a gamemode (pwn + amx)
it actually has everything defined as include (commands, callbacks, defines..etcs)

This is what i've copied in:

Defines
Код:
#define WEAPON_BODY_PART_CHEST 3
#define WEAPON_BODY_PART_CROTCH 4
#define WEAPON_BODY_PART_LEFT_ARM 5
#define WEAPON_BODY_PART_RIGHT_ARM 6
#define WEAPON_BODY_PART_LEFT_LEG 7
#define WEAPON_BODY_PART_RIGHT_LEG 8
#define WEAPON_BODY_PART_HEAD 9
Callbacks
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
{
    if(issuerid != INVALID_PLAYER_ID )
    {
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Am kinda new, and I need help to turn this system to a Filterscript and use a command to able and disable headshot system (ofc will be used by admins or smth)..
Reply
#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
#3

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
Код:
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;
}
What if I want it as a Filterscript?
do I have to write the bodyparts defines?
and how I'll make the command seperated with callback/enum
Reply
#4

Anyone
Reply
#5

bump!
Reply
#6

What exactly do you want to achieve? I don't quite get it.. I'll gladly help you write the command ( or filterscript ) but I'm not sure what I should explain to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)