AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Sniper Skill Bonus v1.1 (https://forums.alliedmods.net/showthread.php?t=90850)

biscuit628 04-23-2009 13:05

Sniper Skill Bonus v1.1
 
1 Attachment(s)
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,Default:3000)
ssb_zoomless <Num>
  • (zoomless bonus,Default:5000)
Changelog:
v1.1 - thank Exolent[jNr] fix my code, remove some useless script
v1.0 - Start

YamiKaitou 04-23-2009 13:16

Re: Sniper Skill Bonus v1.0
 
Quote:

Originally Posted by biscuit628 (Post 812406)
Commands:

They're called cvars, not commands. lol

xPaw 04-23-2009 13:31

Re: Sniper Skill Bonus v1.0
 
Yea thats nice! Good job!

biscuit628 04-23-2009 15:00

Re: Sniper Skill Bonus v1.0
 
Quote:

Originally Posted by YamiKaitou (Post 812414)
They're called cvars, not commands. lol

:oops:ok i edited

Exolent[jNr] 04-23-2009 15:46

Re: Sniper Skill Bonus v1.0
 
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

:arrow:
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().

biscuit628 04-23-2009 16:19

Re: Sniper Skill Bonus v1.0
 
Quote:

Originally Posted by Exolent[jNr] (Post 812528)
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

Exolent[jNr] 04-23-2009 16:22

Re: Sniper Skill Bonus v1.1
 
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].

TitANious 04-23-2009 16:26

Re: Sniper Skill Bonus v1.1
 
I dont think it got so much, just for 1 msg :) But all can happen

biscuit628 04-23-2009 16:30

Re: Sniper Skill Bonus v1.1
 
Quote:

Originally Posted by Exolent[jNr] (Post 812545)
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

A.B. 12-07-2009 05:52

Re: Sniper Skill Bonus v1.1
 
Quick scope bonus, I like it.


All times are GMT -4. The time now is 17:55.

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