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

Crosshair Type


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-17-2012 , 06:49   Crosshair Type
Reply With Quote #1

Crosshair Type


Description:
Change your crosshair to different type

Console Commands:
cmd_show_menu_ch

Changelog:
Code:
V1.0 First release
Special thanks to <VeCo> he's smart
[IMG]http://img585.**************/img585/5272/chmenu.jpg[/IMG]
Attached Files
File Type: sma Get Plugin or Get Source (crosshair_type.sma - 802 views - 2.6 KB)

Last edited by Randomize; 05-17-2012 at 06:59.
Randomize is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 05-17-2012 , 06:57   Re: Crosshair Type
Reply With Quote #2

Quote:
Admin Commands:
cmd_show_menu_ch
Not admin command and not valid command
__________________
kiki33hun is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 05-17-2012 , 08:27   Re: Crosshair Type
Reply With Quote #3

What about recoil ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-17-2012 , 13:50   Re: Crosshair Type
Reply With Quote #4

Quote:
Originally Posted by kiki33hun View Post
Not admin command and not valid command
Quote:
Code:
register_concmd("show_menu_ch","cmd_show_menu_ch")

PHP Code:
register_clcmd("show_menu_ch""cmd_show_menu_ch"
Quote:
Originally Posted by Randomize View Post
Console Commands:
cmd_show_menu_ch

Quote:
show_menu_ch
I also wouldn't make players, num, i, or id static; along with i'd keep i and id defined within the for loop
PHP Code:
new players[32],num
    get_players
(players,num,"a"// get all alive players in the server
 
    
for(new i=0;i<num;i++) // loop trough them...
    
{
        new 
id players[i// store player index in a more convenient variable
 
        
if(<< get_user_weapon(id) & SNIPER_WEAPONS) continue // if this player is holding a sniper - continue with the next player
 
        // else, show the HUD message...
        
        
set_hudmessage(02550, -1.0, -1.0, .holdtime 1.0// skip default values
        
ShowSyncHudMsg(id,sync"%c",user_crosshair_type[id]) // show crosshair HUD  
    

Keeping i and id within the for loops will keep variable overhead down. Won't make much of a difference, but its good practice. IMHO

Last edited by Liverwiz; 05-17-2012 at 15:12.
Liverwiz is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-17-2012 , 17:29   Re: Crosshair Type
Reply With Quote #5

Quote:
Originally Posted by Devil259 View Post
What about recoil ?
Answer that please
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Swaycher
Senior Member
Join Date: Feb 2009
Location: Arg/MyHome/PawnStudio
Old 05-17-2012 , 22:07   Re: Crosshair Type
Reply With Quote #6

Very nice work!
Swaycher is offline
Send a message via MSN to Swaycher Send a message via Skype™ to Swaycher
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2012 , 04:55   Re: Crosshair Type
Reply With Quote #7

Quote:
Originally Posted by Liverwiz View Post

I also wouldn't make players, num, i, or id static; along with i'd keep i and id defined within the for loop
PHP Code:
new players[32],num
    get_players
(players,num,"a"// get all alive players in the server
 
    
for(new i=0;i<num;i++) // loop trough them...
    
{
        new 
id players[i// store player index in a more convenient variable
 
        
if(<< get_user_weapon(id) & SNIPER_WEAPONS) continue // if this player is holding a sniper - continue with the next player
 
        // else, show the HUD message...
 
        
set_hudmessage(02550, -1.0, -1.0, .holdtime 1.0// skip default values
        
ShowSyncHudMsg(id,sync"%c",user_crosshair_type[id]) // show crosshair HUD  
    

Keeping i and id within the for loops will keep variable overhead down. Won't make much of a difference, but its good practice. IMHO
You should never create variables into a loop. It's better to leave them static because the function is called often (every second) and it will be bad if you create new variables on every call.
__________________
<VeCo> is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 05-18-2012 , 05:16   Re: Crosshair Type
Reply With Quote #8

Also, id is only used in the for loop, so you can do :

for( new i = 0, id; i < num; i++ )
__________________
You can do anything you set your mind to, man.

Devil259 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-18-2012 , 06:06   Re: Crosshair Type
Reply With Quote #9

Also, by default, players shoundt' have any additional crosshair, and they should be able to choose "none" in the menu, after having tested custom ones.
Also, why don't you remove the cs crosshair ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2012 , 06:12   Re: Crosshair Type
Reply With Quote #10

Also, return PLUGIN_HANDLED in cmd_show_menu_ch(id) to remove the "unknown command" message.
__________________
<VeCo> 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 19:06.


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