F1 pressed + 1 shot kill

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

F1 pressed + 1 shot kill

Post by Moustache » September 30th, 2010, 8:13 pm

I have 2 questions. I hope someone can and wants to help me :)

1. How can you check if a player presses F1?
I know how to check if a player presses +melee etc, but now how to check if he presses F1 or F2.

2. How can you set it that when you hit a player (in his hand for example) he always dies?
I tried it with self.maxhealth = 20;
But then you get the effect when you got injured, the red flashing screen and the sound effect.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: F1 pressed + 1 shot kill

Post by Drofder2004 » September 30th, 2010, 11:18 pm

Moustache wrote:I have 2 questions. I hope someone can and wants to help me :)

1. How can you check if a player presses F1?
I know how to check if a player presses +melee etc, but now how to check if he presses F1 or F2.

2. How can you set it that when you hit a player (in his hand for example) he always dies?
I tried it with self.maxhealth = 20;
But then you get the effect when you got injured, the red flashing screen and the sound effect.
1. Not possible.
2. Inside the "playerDamage(" function you could add:

iDamage = self.health;
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: F1 pressed + 1 shot kill

Post by Moustache » October 1st, 2010, 7:51 am

Drofder2004 wrote:
Moustache wrote:I have 2 questions. I hope someone can and wants to help me :)

1. How can you check if a player presses F1?
I know how to check if a player presses +melee etc, but now how to check if he presses F1 or F2.

2. How can you set it that when you hit a player (in his hand for example) he always dies?
I tried it with self.maxhealth = 20;
But then you get the effect when you got injured, the red flashing screen and the sound effect.
1. Not possible.
2. Inside the "playerDamage(" function you could add:

iDamage = self.health;
Ok, thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests