Raised This Month: $94 Target: $400
 23% 

Scope Alert


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Event Related        Approver:   Hawk552 (427)
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-14-2009 , 12:18   Scope Alert
Reply With Quote #1

Scope Alert
By xPaw

.: Description :.
Requested here - link

When enemy aimed on you with scope from scout or awp, you will get small red screen fade, wich will mean what you was been aimed. ;)
Video
.: Cvars :.
sv_scopealert 0/1 - allow/disable scope alert? (default: 1)
.: Credits :.
  • minimiller - Testing.
  • arkshine - Tips, tips, tips...
Attached Files
File Type: sma Get Plugin or Get Source (ScopeAlert.sma - 5064 views - 1.4 KB)
__________________

Last edited by xPaw; 08-29-2009 at 12:38.
xPaw is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-14-2009 , 12:22   Re: Scope Alert v1.0
Reply With Quote #2

xPaw doesn't stop
joaquimandrade is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-14-2009 , 12:24   Re: Scope Alert v1.0
Reply With Quote #3

what do you mean? O_o
__________________
xPaw is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-14-2009 , 12:25   Re: Scope Alert v1.0
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
what do you mean? O_o
I mean that you don't stop. You're always coding (<-- I hate this smiley image. It make us seem like we are 10 years old)

Last edited by joaquimandrade; 02-14-2009 at 13:10.
joaquimandrade is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-14-2009 , 12:27   Re: Scope Alert v1.0
Reply With Quote #5

haha you're right
__________________
xPaw is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-14-2009 , 12:35   Re: Scope Alert v1.0
Reply With Quote #6

Nice. You gaved me an ideea =D
__________________

anakin_cstrike is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 02-14-2009 , 12:36   Re: Scope Alert v1.0
Reply With Quote #7

Nice plugin.

One question though: Why don't you rely on tracelines? Just interested in your reasoning.
__________________
In Flames we trust!

Last edited by Nextra; 03-17-2009 at 16:49.
Nextra is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-14-2009 , 12:37   Re: Scope Alert v1.0
Reply With Quote #8

i dont understand you Oo
__________________
xPaw is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 02-14-2009 , 12:39   Re: Scope Alert v1.0
Reply With Quote #9

Just wanted to know why you check get_user_aiming on preThink instead of hooking FM_TraceLine and doing your checks there.
__________________
In Flames we trust!

Last edited by Nextra; 03-17-2009 at 16:50.
Nextra is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-14-2009 , 12:39   Re: Scope Alert v1.0
Reply With Quote #10

You should do something like that :

Code:
public fwdPlayerPreThink( id ) {     if( get_pcvar_num(g_Enabled) && is_user_alive(id) )     {         new iTarget, iBody;         get_user_aiming( id, iTarget, iBody );                 if( is_user_alive(iTarget) && !g_AlreadyZoomed[iTarget] && get_user_team(id) != get_user_team(iTarget) )         {             if ( CS_SET_FIRST_ZOOM <= cs_get_user_zoom(id) <= CS_SET_SECOND_ZOOM )             {                 //             }         }     } }

Added a check if player is alive and organized in a way you get less extra instructions.

About the duration/holdtime/color more easily, it should be customizable.
About the flag, instead of writing 0, it would be a good idea to do a define like in HLSDK : #define FFADE_IN 0x0000
Arkshine is offline
Reply


Thread Tools
Display Modes

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 23:28.


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