Raised This Month: $114 Target: $400
 28% 

Sniper Skill Bonus v1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 04-23-2009 , 14:05   Sniper Skill Bonus v1.1
Reply With Quote #1

Sniper Skill Bonus v1.1

Description:
Hello,this is my second plugin
when player using the sniper skill kill someone, he will get bonus
Zoomless = No zoom
Fastshot = i don't know how to explain,here is a youtube video

Cvars:



ssb_on <0/1>
  • (Plugin on/off,Default:1)
ssb_fastshot <Num>
  • (fastshot bonus,Default000)
ssb_zoomless <Num>
  • (zoomless bonus,Default:5000)
Changelog:
v1.1 - thank Exolent[jNr] fix my code, remove some useless script
v1.0 - Start
Attached Files
File Type: sma Get Plugin or Get Source (Sniper_Skill_bonus.sma - 3908 views - 2.3 KB)
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!

Last edited by biscuit628; 04-25-2009 at 20:11. Reason: fix my poor english
biscuit628 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-23-2009 , 14:16   Re: Sniper Skill Bonus v1.0
Reply With Quote #2

Quote:
Originally Posted by biscuit628 View Post
Commands:
They're called cvars, not commands. lol
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-23-2009 , 14:31   Re: Sniper Skill Bonus v1.0
Reply With Quote #3

Yea thats nice! Good job!
__________________
xPaw is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 04-23-2009 , 16:00   Re: Sniper Skill Bonus v1.0
Reply With Quote #4

Quote:
Originally Posted by YamiKaitou View Post
They're called cvars, not commands. lol
ok i edited
biscuit628 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-23-2009 , 16:46   Re: Sniper Skill Bonus v1.0
Reply With Quote #5

1. static vname[32], kname[32], msg[256]

Create those variables inside of the ham_killed() function since they are only used there.


2. fw_prethink():

Cache the values that are retrieved more than once.
Also, you don't need a conditional to check true/false.
PHP Code:
g_Zoomless[id] = ( pevidpev_button ) & IN_ATTACK && ( wpn == CSW_AWP || wpn == CSW_SCOUT ) && cs_get_user_zoomid ) == CS_SET_NO_ZOOM ) ? true false;    
g_fastshot[id] = ( pevidpev_button ) & IN_ATTACK && pevidpev_button ) & IN_ATTACK2 && ( wpn == CSW_AWP || wpn == CSW_SCOUT ) && cs_get_user_zoomid ) == CS_SET_FIRST_ZOOM) ? true false

PHP Code:
new button pevidpev_button );
new 
zoom cs_get_user_zoomid );

g_Zoomless[id] = ( button IN_ATTACK && ( wpn == CSW_AWP || wpn == CSW_SCOUT ) && zoom == CS_SET_NO_ZOOM );    
g_fastshot[id] = ( button IN_ATTACK && button IN_ATTACK2 && ( wpn == CSW_AWP || wpn == CSW_SCOUT ) && zoom == CS_SET_FIRST_ZOOM); 


3. cs_set_user_money(killer,cs_get_user_money(ki ller)+bonus);

You need to force the range of the money to 0-16000
PHP Code:
cs_set_user_money(killer,clamp(cs_get_user_money(killer)+bonus016000)); 


4. get_user_msgid("SayText")

Create a global variable and set it to this inside plugin_init() and then use that variable in message_begin().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 04-23-2009 , 17:19   Re: Sniper Skill Bonus v1.0
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
1. static vname[32], kname[32], msg[256]

Create those variables inside of the ham_killed() function since they are only used there.
....
Thank you so much, update version 1.1
biscuit628 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-23-2009 , 17:22   Re: Sniper Skill Bonus v1.1
Reply With Quote #7

1 more thing I forgot to point out:
The message length for a SayText message is maxed at 191, so it should be msg[192].
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-23-2009 , 17:26   Re: Sniper Skill Bonus v1.1
Reply With Quote #8

I dont think it got so much, just for 1 msg But all can happen
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 04-23-2009 , 17:30   Re: Sniper Skill Bonus v1.1
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
1 more thing I forgot to point out:
The message length for a SayText message is maxed at 191, so it should be msg[192].
thank,
I fix that now, version still 1.1
biscuit628 is offline
A.B.
Member
Join Date: Nov 2009
Old 12-07-2009 , 06:52   Re: Sniper Skill Bonus v1.1
Reply With Quote #10

Quick scope bonus, I like it.
A.B. 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 17:41.


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