Raised This Month: $59 Target: $400
 14% 

Vote Knife plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:          Approver:   Brad (55)
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-19-2005 , 10:42   Vote Knife plugin
Reply With Quote #1

Hello.
This is my first plugin, and I made it because of this request.

Thanks to VEN for critique and help!

Updates:
18/5
Changed ther register event thingy to register_event("CurWeapon", "cur_weapon", "be", "1=0", "2=29") as VEN suggested
And I added so that you can write /voteknife instead.
Fixed some bugs.

23/12
Changed the "2!=knife" to "2!29".

21/12
Added a cvar, for enabling/disabling hud messages.
Now the hud messages is above the cross hair instead of in it

20/12
Fixed some errors (like the rounds were bugged)
Fixed so that the chat won't be spammed each time a message is shown.
Fixed the chat messages (only some of them were visible)
Fixed the weapon event (less code now)

19/12
Added chat messages.

If something should be changed, please say that so I can fix it

Cvars:
Code:
amx_vote_knife 1                  // Should plugin be on or off? amx_vote_knife_time 20.0     // How long time does the players have to vote? amx_vote_knife_ratio 0.5       // How many percent of the players need to vote? (example: 0.1 = 10%) amx_vote_knife_rounds 3      // How many rounds will it be knife only? amx_vote_knife_hud 1          // Hud messages on or off? amx_vote_knife_cooldown 3  // How many rounds to wait after the knife only rounds?
NOTE: restmenu.amxx and fun module needs to be activated for this plugin to work.
Attached Files
File Type: sma Get Plugin or Get Source (knife_only_vote.sma - 3600 views - 6.2 KB)
__________________
"My mouth is dry... My face is numb..." ~ Brain Stew - Green Day
Rains is offline
Send a message via MSN to Rains
Sir Apocalypse
Member
Join Date: Jul 2005
Location: Finland
Old 12-19-2005 , 11:17  
Reply With Quote #2

Plugins like this is released already but still quite good.
__________________
[img]http://img56.**************/img56/864/sirapocalypse1yh.gif[/img]
Sir Apocalypse is offline
Send a message via MSN to Sir Apocalypse
Dire
Member
Join Date: Sep 2005
Location: A place called earth!
Old 12-19-2005 , 11:21   Re: Vote Knife plugin
Reply With Quote #3

Quote:
Originally Posted by Rains
amx_vote_knife_rounds 3 // How many rounds will it be knife only?
amx_vote_knife_cooldown 3 // How many rounds to wait after the knife only rounds?
I don't think any other knife plugins have that option, do they?
Dire is offline
Send a message via AIM to Dire
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-19-2005 , 12:58   Re: Vote Knife plugin
Reply With Quote #4

Quote:
Originally Posted by Dire
Quote:
Originally Posted by Rains
amx_vote_knife_rounds 3 // How many rounds will it be knife only?
amx_vote_knife_cooldown 3 // How many rounds to wait after the knife only rounds?
I don't think any other knife plugins have that option, do they?
Hehe, that was the main idea
The guy who wanted it couldn't find a knife only mod with rounds.
Rains is offline
Send a message via MSN to Rains
Dire
Member
Join Date: Sep 2005
Location: A place called earth!
Old 12-19-2005 , 13:50  
Reply With Quote #5

If this works, I'd pick this plug-in over the other knife-only plugins.

Good job! I'll test it when I get home (1 hour, woot).
Dire is offline
Send a message via AIM to Dire
Mcoy
Member
Join Date: Aug 2005
Old 12-19-2005 , 14:35  
Reply With Quote #6

i cant get it to work... it is running (amxx plugins), the amx_vote_knife is 1. still dont work when i say /knife or knife. And no message that it is available (Write /knife to vote for knife only!^nYou have %i seconds to vote!).

Would i need to use Amxx 1.6...? I still have 1.5.... but that should not be the reason?
__________________
Mcoy is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-19-2005 , 15:06  
Reply With Quote #7

Code:
// public knife_only(id) {     strip_user_weapons(id)     give_item(id, "weapon_knife") }
I think strip isn't good idea.
In my opinion better just force switch to knife if player try to change weapon (use CurWeapon event).
Code:
        client_cmd(0,"amx_restrict off ammo")
This is not client-side-only command so you shouldn't exec it on every client. This is console command with access ADMIN_CFG (flag "h") which configure server side restriction (not client side!).
Code:
//         client_cmd(0,"amx_restrict off ammo")         client_cmd(0,"amx_restrict off equip")         client_cmd(0,"amx_restrict off pistol")         client_cmd(0,"amx_restrict off shotgun")         client_cmd(0,"amx_restrict off sub")         client_cmd(0,"amx_restrict off rifle")         client_cmd(0,"amx_restrict off machine")
You do not need to repeat this(or similar to this) code.
Use loops instead.
VEN is offline
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-19-2005 , 15:06  
Reply With Quote #8

Hmm, weird, I'll check it out.

Ok, I'll change the stuff you talked about

EDIT: I have changed some stuff, but not the loop, how would I make that a loop? :S Oh well, since I forced the player to change to knife, I didn't need to restrict the weapons anymore.

The plugin will now work ^^
Rains is offline
Send a message via MSN to Rains
Mcoy
Member
Join Date: Aug 2005
Old 12-19-2005 , 15:34  
Reply With Quote #9

so i donwload and try again...?
__________________
Mcoy is offline
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-19-2005 , 15:36  
Reply With Quote #10

Yes, at least now you can. ^^
Rains is offline
Send a message via MSN to Rains
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 15:52.


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