Raised This Month: $51 Target: $400
 12% 

All Snipers Crosshair [3.1]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 10-10-2008 , 07:18   All Snipers Crosshair [3.1]
Reply With Quote #1

All Snipers Crosshair
by tuty


Author : tuty

Version: 3.0

Description : This plugin make to all CS 1.6 snipers a crosshair.

Credits: Originally maked by hip_hop_x , i just maked to all snipers

CVARs :

snipers_crosshair 1 or 0

1 = Enabled (default).
0 = Disabled.

Changelog:
PHP Code:
/*
maked public on version 2.0
Updated to 2.0++
Removed CStrike module
Updated to version 3.0 
*/ 


UPDATED TO VERSION 3.1


thx connor!

UPDATED!


Because i fixed a bug: when you use zoom, or u switch sniper fast, the crosshair appear bad.


- Now fixed, but in zoom will appear hl crosshair
- This version is much better.







Attached Thumbnails
Click image for larger version

Name:	2.jpg
Views:	27336
Size:	37.6 KB
ID:	32410   Click image for larger version

Name:	4.jpg
Views:	26675
Size:	51.6 KB
ID:	32411   Click image for larger version

Name:	awp.jpg
Views:	35193
Size:	45.9 KB
ID:	32412   Click image for larger version

Name:	scout.jpg
Views:	21952
Size:	40.1 KB
ID:	32413  
Attached Files
File Type: sma Get Plugin or Get Source (all_snipers_crosshair.sma - 5845 views - 2.0 KB)
__________________

Last edited by tuty; 09-17-2009 at 15:25.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-10-2008 , 07:41   Re: All Snipers Crosshair
Reply With Quote #2

You don't need to include cstrike.
You don't need to check weapon if you register the event with filters.
You don't need to check 2 times the cvar value.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-10-2008 at 12:19. Reason: arkshine's code more customizable :)
ConnorMcLeod is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 10-10-2008 , 07:46   Re: All Snipers Crosshair
Reply With Quote #3

oh 10x UPDATED!
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Old 10-10-2008, 08:04
Arkshine
This message has been deleted by Arkshine. Reason: Wrong code.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-10-2008 , 14:59   Re: All Snipers Crosshair
Reply With Quote #4

My previous code was wrong.

Here the right one. The changes are admin can choose what weapons he wants and I change cvar to command so the code ( GetSniperFlags() ) is called only when necessary.

a - scout
b - sg550
c - awp
d - g3sg1

Code:
#include <amxmodx> #include <amxmisc> new gi_MsgCrosshair; new gi_Flags; #define IsWeaponAllowed ( gi_Flags & ( 1 << read_data ( 2 ) ) ) public plugin_init() {     register_plugin ( "All Snipers Crosshair", "2.0", "tuty" );     register_event ( "CurWeapon", "Event_CurWeapon", "be" , "1=1", "2=3", "2=13", "2=18", "2=24" )       register_concmd ( "amx_snipers_crosshair", "Command_Crosshair", ADMIN_CFG, "amx_snipers_crosshair <flags>" );     gi_MsgCrosshair = get_user_msgid ( "Crosshair" ); }   public Event_CurWeapon ( const id ) {     // --| Add a crosshair if allowed for this weapon.     // --| Note: crosshair disappears after each shot, so need to update each time. :/     if ( IsWeaponAllowed )     {         message_begin ( MSG_ONE_UNRELIABLE, gi_MsgCrosshair , _, id );         write_byte ( 1 );         message_end ();     } } public Command_Crosshair ( id, level, cid ) {     if ( cmd_access ( id, level, cid, 2 ) )     {         // --| Retrieve the flags from command.         new s_Flags[ 5 ]; read_argv ( 1, s_Flags, charsmax ( s_Flags ) );                 // --| Get the flags value. Called only when the command is used.         GetSniperFlags ( s_Flags );     }         return PLUGIN_HANDLED; } GetSniperFlags ( const s_Flags[] ) {     // --| Snipes reference id.     static const i_SnipersIds[] = { CSW_SCOUT , CSW_SG550 , CSW_AWP , CSW_G3SG1 };         // --| Initiliaze values.     new i, c_Letter, i_Val; gi_Flags = 0;     // --| Get the bitwise sum considering the snipes id.     while ( ( c_Letter = s_Flags[ i++ ] ) )     {         i_Val = c_Letter - 'a';         if ( 0 <= i_Val < sizeof  ( i_SnipersIds ) )         {             gi_Flags |= ( 1 << ( i_SnipersIds[ i_Val ] ) ); // --| Connor's idea after reading read_flags() source code.         }     } }
__________________

Last edited by Arkshine; 10-20-2008 at 07:37. Reason: Fixed some errors.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-11-2008 , 01:31   Re: All Snipers Crosshair
Reply With Quote #5

Quote:
Originally Posted by arkshine View Post
e - sg552 is not a sniper.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-11-2008 at 05:11.
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-11-2008 , 04:42   Re: All Snipers Crosshair
Reply With Quote #6

Ooups. ^^
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-11-2008 , 05:10   Re: All Snipers Crosshair
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
Ooups. ^^
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Churchboy587
BANNED
Join Date: Oct 2008
Old 10-11-2008 , 11:13   Re: All Snipers Crosshair
Reply With Quote #8

I hate these sniper crosshairs. Whenever you pull out a gun with that crosshaird, your character shakes. When you aim, he shakes. When you pull the gun back out, he shakes. This isn't a very good crosshair if you shake for 2-3 seconds every time gun is pulled out.
Churchboy587 is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 10-11-2008 , 11:58   Re: All Snipers Crosshair
Reply With Quote #9

only awp she shakes.......wathc in game man...don't say after..... only awp shakes.
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-11-2008 , 13:23   Re: All Snipers Crosshair
Reply With Quote #10

There's no shake with this plugin.

tuti you should really update with #4 code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 03:37.


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