Raised This Month: $32 Target: $400
 8% 

Knifes Only(Zaltoa)


Post New Thread Reply   
 
Thread Tools Display Modes
^Luisito^
Junior Member
Join Date: Dec 2005
Old 01-29-2006 , 08:56   asd
Reply With Quote #41

This plugin is good but.. can you when I say /voteknifesonly and the knife is actived start a vote with only option?.

Example: Knives off, I say /voteknifesonly -- KNIVES ON? Yes no
Knives on, I say /voteknifesonly -- KNIVES OFF?? Yes no


Sorry for my english.
^Luisito^ is offline
Send a message via MSN to ^Luisito^
BoK | Krazy
Member
Join Date: Dec 2005
Location: Dayton, OH
Old 01-29-2006 , 18:27  
Reply With Quote #42

BillyTheKid I do not know if you are working on this plugin anymore or not but knifesonly I think should be knivesonly. And the way you programmed the plugin it did not check for the admin access for the cvars so anyone could turn it on and off. Also v3x and teame06 coded a new way so it would not have to drop the weapons all over the ground. So if you do update it to this code give them credit.

Code:
/*********************************************************************
AMX Mod Script
Created by BillyTheKid
Test it first @ 69.31.7.140:27016
Knives Only
Version 0.7
Email = admin@madtechview

Commands -
amx_knivesonly <1|0> Default off

1 = on
0 = off

Client Command -
say /voteknivesonly
Starts a vote to turn knives Only On and off...


Description - This will force users to knife only
              If guns are drawn they will be dropped


BugFixes    - Added Admin Level Access to the amx_knivesonly Command
  		  and added vote Level Access for the /voteknivesonly

Added - 	  I added a command for voting instead of /voteknivesonly 
              an admin can do a amx_voteknivesonly

Thanks to Zaltoa @ [email protected]
I used his code as a template to make this one 
*********************************************************************/

#include <amxmodx>
#include <amxmisc>


new knifeonly = 0
new choice[2]
new voteknifesonly[] = "\yKnives Only?\w^n^n1. Yes^n2. No"

public plugin_init(){
register_plugin("Knives Only","0.1","BillyTheKid")
register_concmd("amx_knivesonly","cmdknifes_only",ADMIN_LEVEL_A,"- disable and enable knife war 1 = on 0 = off")
register_concmd("amx_voteknivesonly","cmdvoteknifes_only",ADMIN_LEVEL_A,"- Starts a vote for Knives Only")
register_concmd("say /voteknivesonly","cmdvote",ADMIN_LEVEL_A,"- Starts a vote for Knives Only")
register_menucmd(register_menuid("\yKnives Only?"),(1<<0)|(1<<1),"count_votes")
register_event("CurWeapon","knife","b","1=1")
}

public cmdknifes_only(id,level,cid){
   if (!cmd_access(id,level,cid,1))
   return PLUGIN_CONTINUE

   new arg[2]
   read_argv(1,arg,1)

   new cAdmin[32], cAuthid[32] 
   get_user_name(id, cAdmin, 31) 
   get_user_authid(id, cAuthid, 31) 
   set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)
   if(equal(arg,"1")){
   knifeonly = 1
   client_cmd(id,"weapon_knife")
   console_print(id,"Knives Only has been turned on.")
   show_hudmessage(0,"Knives Only has been turned on.")
   log_amx("%s<%s> has turned Knives Only on", cAdmin, cAuthid)
   } else if(equal(arg,"0")){
   knifeonly = 0
   console_print(id,"Knives Only has been turned off.")
   show_hudmessage(0,"Knives Only has been turned off.")
   log_amx("%s<%s> has turned Knives Only off", cAdmin, cAuthid)
   } else {
   if (knifeonly==0){
   console_print(id,"Usage: amx_knivesonly 1 = 0n 0 = off Currently: OFF")
   }
   if (knifeonly==1){
   console_print(id,"Usage: amx_knivesonly 1 = 0n 0 = off Currently: ON")
   }
   }
   return PLUGIN_CONTINUE
   }

public knife(id)
{
	if(knifeonly)
	{
		new wpID = read_data(2)
		if(wpID != CSW_KNIFE && wpID != CSW_C4)
		{
			engclient_cmd(id, "weapon_knife")
                }
        }
        return PLUGIN_CONTINUE
}

public cmdvote(id,level,cid){
    if (!cmd_access(id,level,cid,1))
    return PLUGIN_CONTINUE

    new Float:voting = get_cvar_float("amx_last_voting")
    new cAdmin[32], cAuthid[32] 
    get_user_name(id, cAdmin, 31) 
    get_user_authid(id, cAuthid, 31)
    if (voting > get_gametime()){
        client_print(id,print_chat,"*A vote has already been cast.*")
        return PLUGIN_HANDLED
    }
    if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {
        client_print(id,print_chat,"*Please wait awhile before you can vote again.*")
        return PLUGIN_HANDLED
    }
    new menu_msg[256]
    format(menu_msg,255,voteknifesonly)
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0
    set_cvar_float("amx_last_voting",  get_gametime() + votetime )
    show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime))
    set_task(votetime,"check_the_votes")
    client_print(0,print_chat,"*Voting has started.*")
    log_amx("%s<%s> started a vote for Knives Only", cAdmin, cAuthid)
    choice[0]=choice[1]=0
    return PLUGIN_HANDLED     
}

public cmdvoteknifes_only(id,level,cid){
    if (!cmd_access(id,level,cid,1))
    return PLUGIN_CONTINUE

    new cAdmin[32], cAuthid[32] 
    get_user_name(id, cAdmin, 31) 
    get_user_authid(id, cAuthid, 31)
    new Float:voting = get_cvar_float("amx_last_voting")
    if (voting > get_gametime()){
        client_print(id,print_chat,"*A vote has already been cast.*")
        return PLUGIN_HANDLED
    }
    if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {
        client_print(id,print_chat,"*Please wait awhile before you can vote again.*")
        return PLUGIN_HANDLED
    }
    new menu_msg[256]
    format(menu_msg,255,voteknifesonly)
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0
    set_cvar_float("amx_last_voting",  get_gametime() + votetime )
    show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime))
    set_task(votetime,"check_the_votes")
    client_print(0,print_chat,"*Voting has started.*")
    log_amx("%s<%s> started a vote for Knives Only", cAdmin, cAuthid)
    choice[0]=choice[1]=0
    return PLUGIN_HANDLED     
}


public count_votes(id,key){
    if (get_cvar_float("amx_vote_answers") ) {
        new name[32]
        get_user_name(id,name,31)
        client_print(0,print_chat,"* %s voted %s", name, key ? "against Knives Only" : "for Knives Only" )
    }
    ++choice[key]
    return PLUGIN_HANDLED
}

public check_the_votes(id){
    if (choice[0] > choice[1]){
        server_cmd("amx_knivesonly 1")
        client_print(0,print_chat,"* Votes For Knives Only Succeded (yes ^"%d^") (no ^"%d^"). *",choice[0],choice[1])
    } else {
        server_cmd("amx_knivesonly 0")
        client_print(0,print_chat,"* Votes Against Knives Only Succeded (yes ^"%d^") (no ^"%d^"). *",choice[0],choice[1])
    }
    return PLUGIN_CONTINUE
}
__________________
BoK | Krazy is offline
Send a message via AIM to BoK | Krazy
crazydog115
Junior Member
Join Date: Jan 2006
Old 02-10-2006 , 21:20  
Reply With Quote #43

what access level do the users need for this? The players in my server cannot use the /knifesonly command.
crazydog115 is offline
BoK | Krazy
Member
Join Date: Dec 2005
Location: Dayton, OH
Old 02-11-2006 , 11:48  
Reply With Quote #44

First of all it is /voteknivesonly if you are using the one I posted above.

And if you want it so anyone can start votes you will have to change
Code:
register_concmd("amx_voteknivesonly","cmdvoteknifes_only",ADMIN_LEVEL_A,"- Starts a vote for Knives Only") 
register_concmd("say /voteknivesonly","cmdvote",ADMIN_LEVEL_A,"- Starts a vote for Knives Only")
to
Code:
register_concmd("amx_voteknivesonly","cmdvoteknifes_only",0,"- Starts a vote for Knives Only") 
register_concmd("say /voteknivesonly","cmdvote",0,"- Starts a vote for Knives Only")
__________________
BoK | Krazy is offline
Send a message via AIM to BoK | Krazy
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 02-11-2006 , 12:02  
Reply With Quote #45

Hello,

Wow. Nice plugin. But can you add a function that automaticle come a vote after a time that the admin can edit?
That were perfect!

Bye
__________________
DA is offline
storm1811
Member
Join Date: Jun 2005
Old 05-01-2006 , 09:25  
Reply With Quote #46

This does not work for me.

When the map changes to anothuer map i have to do the command

amx_knifesonly 1 to turn it back on.

Can anyone tell me why i have to do this everytime it changes map
storm1811 is offline
seoulxkorean
Member
Join Date: Apr 2006
Old 05-01-2006 , 10:54  
Reply With Quote #47

Quote:
Originally Posted by storm1811
This does not work for me.

When the map changes to anothuer map i have to do the command

amx_knifesonly 1 to turn it back on.

Can anyone tell me why i have to do this everytime it changes map
Change the default value in the .sma to 1 or make a CVAR so that it won't change on map changes (only on server restarts).
seoulxkorean is offline
pandaking
Senior Member
Join Date: Jun 2006
Old 06-13-2006 , 14:14  
Reply With Quote #48

A few questions:
Will this make users frop their weapons, or will it just switch to knife, and not allow them to switch?

Also, is there a way you could add the function of knifing to only last one round, ie. it's 1 on 1, and one of them says do you want to knife? The other one agrees (by the voting, or I could just make them knife lol) and they go to battle. On next spawn, everything os back to normal again.

Please can you get back to me, there are so many knife mods, and none seem to do what I hope
pandaking is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 03-04-2008 , 10:25   Re: Knifes Only(Zaltoa)
Reply With Quote #49

it dosent work for me i added

amx_knifesonly 0|1 {disable|enable}
amx_voteknifesonly

in the amxx.cfg(is that right?)
but dont know where to put the other command.
help plz!
micke1101 is offline
Cursed You
Member
Join Date: Apr 2008
Old 05-03-2008 , 16:01   Re: Knifes Only(Zaltoa)
Reply With Quote #50

Thanks soo badly!! This is the best plugin ever dude! Now players finaly can't cheat on using guns!
__________________
[Hide 'N' Seek] 24/7 Awp_rooftops
Ip: 85.190.39.176:27016
Players: 16
VAC Secure
Cursed You 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 12:05.


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