Page 1 of 1

armor

Posted: Wed Mar 28, 2007 2:43 am
by darksmaster923
how can i do armor without the inventory. or script it with a var.

Posted: Wed Mar 28, 2007 2:47 am
by zany_001
you could do a second attribute, and have that harmed before the health is harmed.

Posted: Wed Mar 28, 2007 4:52 am
by darksmaster923
that would be really cheap. just charge in with guns blazing and dont die, even if theres 7 baddies.
heres a script i worked up in like, 2 seconds. would it work, havent tested it yet

EDIT
It doesnt work :cry: lol

Code: Select all

{
	INIT		[0]
	INITARMOR	[0]

	Spawn[ ()
	{
		Console(false);
		LowLevel("Setup");
	} ]

	Setup[ ()
	{
		PawnRender(false);
		INIT = GetAttribute("playerhealth", "Player");
		INITARMOR = GetAttribute("armor", "Player");
		self.think = "Armor";
	} ]
	
	Armor[ ()
	{
		self.ThinkTime = "0.3";
		if(GetAttribute("playerhealth", "Player") < INIT);
		{
			INIT = GetAttribute("playerhealth", "Player");
			if(GetAttribute("armor", "Player") < INITARMOR);
			{
				if(GetAttribute("armor", "Player") > 0);
				{
					ModifyAttribute("armor", -17, "Player");
					ModifyAttribute("playerhealth", 11, "Player");
					INITARMOR = GetAttribute("armor", "Player");
				}
			}
		}
	} ]
}

Posted: Wed Mar 28, 2007 5:58 am
by zany_001
no, it wont be cheap,cos,itd be like having 100 health,with,say,5o armor on top,so 150 altogether

Posted: Wed Mar 28, 2007 10:46 am
by Juutis
Well, first of all, you have a ';' after every if( ) statement. That's not supposed to be there. You should always try these things with the console on to see if there are syntax errors.

Secondly, I don't get this part:

Code: Select all

if(GetAttribute("armor", "Player") < INITARMOR)
If I understood it correctly, you set INITARMOR = 'armor' attribute. Then the 'armor' attribute isn't changed at any part, the enemies damage only the 'playerhealth' attribute, right? So INITARMOR can't be less than 'armor' because they both remain the same.



***EDIT***
Oh, and to be honest. I don't like your way of posting.
heres a script i worked up in like, 2 seconds. would it work, havent tested it yet
You post all these things without even trying them yourself :?: :roll:

Posted: Wed Mar 28, 2007 4:53 pm
by darksmaster923
uhhhhhhhhh.....................no...........

Posted: Fri Mar 30, 2007 12:22 am
by darksmaster923
omg i had an idea.
wat about if you pick up armor, a pawn goes in front of you. bot shoot pawn until it dies and your not safe no more :twisted:

Posted: Fri Mar 30, 2007 4:32 am
by zany_001
bot shoot pawn?

Posted: Fri Mar 30, 2007 5:07 am
by darksmaster923
ya

Posted: Fri Mar 30, 2007 5:16 am
by zany_001
what does it mean tho?wat bot,what pawn,why does it shoot,what happens that is so amazing,im confuuuuused :cry:

Posted: Fri Mar 30, 2007 5:28 am
by darksmaster923
when the player has armor, i place the pawn in front of the player, making HIMm in the way of bullets

Posted: Fri Mar 30, 2007 6:08 am
by zany_001
Oooooooooooooooooh!i get it!

Cant you just use the armor attribute like it says in the manual,and have 1oo% protection,and if the armor is,say,50,then the damagetoarmor percent is 2%??

Posted: Fri Mar 30, 2007 4:53 pm
by darksmaster923
for that i need an inentory

okay, made my script, but i cant jump.
and cant crouch :(