Raised This Month: $ Target: $400
 0% 

if hit user else


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
monkey.
Junior Member
Join Date: Jul 2012
Location: Estonia
Old 08-06-2014 , 22:03   if hit user else
Reply With Quote #1

Hello, i need something like this

if dont hit user(id){
screen fade(id)
}
else{
nothing happens
}

i have the code for screen fade but i dont know how to do the if hit enemy thing
monkey. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-07-2014 , 00:29   Re: if hit user else
Reply With Quote #2

You'll need to explain in more detail regarding what you want (don't use any code to describe it).

If I had to guess, you would need to hook Ham_TakeDamage and process information from there.
__________________
fysiks is offline
monkey.
Junior Member
Join Date: Jul 2012
Location: Estonia
Old 08-07-2014 , 07:58   Re: if hit user else
Reply With Quote #3

Well i need the users screen to fade if he shoots somewhere randomly, but when he hits someone from the enemies then his screen wont fade.
monkey. is offline
Decak
Senior Member
Join Date: Sep 2012
Old 08-07-2014 , 08:09   Re: if hit user else
Reply With Quote #4

Register Client PreThink, define Button and use someone like this:
Code:
if(Button == FIRE) {
set_fade...
Decak is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-07-2014 , 08:43   Re: if hit user else
Reply With Quote #5

Quote:
Originally Posted by monkey. View Post
Well i need the users screen to fade if he shoots somewhere randomly, but when he hits someone from the enemies then his screen wont fade.
But what if he is close but still misses?

Quote:
Originally Posted by Decak View Post
Register Client PreThink, define Button and use someone like this:
Code:
if(Button == FIRE) {
set_fade...
There are much better ways to determine when someone shoots. This method is bad (and wrong).
__________________

Last edited by fysiks; 08-07-2014 at 08:44.
fysiks is offline
monkey.
Junior Member
Join Date: Jul 2012
Location: Estonia
Old 08-07-2014 , 09:08   Re: if hit user else
Reply With Quote #6

Like it doesnt matter how far or close he is, if he doesnt hit anyone then screen fades but if hits enemy then doesnt fade
monkey. is offline
Decak
Senior Member
Join Date: Sep 2012
Old 08-07-2014 , 10:30   Re: if hit user else
Reply With Quote #7

@fysiks no only this code, this need some checks...
Decak is offline
monkey.
Junior Member
Join Date: Jul 2012
Location: Estonia
Old 08-24-2014 , 07:00   Re: if hit user else
Reply With Quote #8

Could someone help with this then? I am not the best coder.
monkey. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-24-2014 , 07:25   Re: if hit user else
Reply With Quote #9

Quote:
Originally Posted by Decak View Post
@fysiks no only this code, this need some checks...
Still a bad ideea.

Since you are in scripting help forum, don't expect that you will receive already made code. You can send a trace and check it's results. If the trace don't hit a player from the enemy team, fade screen.
__________________

Last edited by HamletEagle; 08-24-2014 at 07:25.
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode