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

Knives Only


Post New Thread Reply   
 
Thread Tools Display Modes
FreaKy_FlaSh
Junior Member
Join Date: Jul 2006
Old 09-16-2006 , 06:54   Re: Knives Only
Reply With Quote #11

hey i found tht a guy who has same plugin installed in his cs (though he is not an admin in my server - he's regular or normal player)....can turn on or off this plugin in my server, i didnt modify the plugin in anyway by changing access flags or anything at all.

please help.
FreaKy_FlaSh is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-16-2006 , 09:31   Re: Knives Only
Reply With Quote #12

Quote:
Originally Posted by FreaKy_FlaSh View Post
hey i found tht a guy who has same plugin installed in his cs (though he is not an admin in my server - he's regular or normal player)....can turn on or off this plugin in my server, i didnt modify the plugin in anyway by changing access flags or anything at all.

please help.
Try this -->

Code:
/****************************************************
* AMX Mod X Script for Counter-Strike 1.6            *
* by "SilverTide"                                    *
* Knives Only                                        *
* Version 0.1a                                        *
* Email = [email protected]                    *
* http://warcraft3server.com                        *
*                                                     *
* Credits:                                            *
*  Billythekid - I had to use his knifes only      *
*                plugin as a reference.            *
*                                                    *
* Admin Commands -                                    *
* amx_knivesonly <1|0> (Default: 0)                *
*  [ Enables or Disables knives only mode ]        *
*                                                     *
* Client Commands-                                    *
* say /voteknivesonly                                *
*  [ Starts a vote for knives only mode ]            *
*                                                     *
*                                                     *
* PLUGIN DESCRIPTION : -----------------            *
* Users will be forced to use knives                *
* only, any other weapons will be                    *
* removed.                                            *
*                                                    *
****************************************************/

#include <amxmodx>
#include <amxmisc>
#include <fun>

new knifeonly = 0;
new choice[2];
new voteknivesonly[] = "\yKnives Only?\w^n^n1. On^n2. Off";

public plugin_init () {
    register_plugin ( "Knives Only", "0.1a", "SilverTide" );
    register_concmd ( "amx_knivesonly", "cmdknives_only", ADMIN_LEVEL_A, "- Turns on or off Knives Only." );
    register_concmd ( "amx_voteknivesonly", "cmdvoteknives_only", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
    register_concmd ( "say /voteknivesonly", "cmdvote", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
    register_menucmd ( register_menuid("\yKnives Only?"), (1<<0)|(1<<1), "count_votes" );
    register_event ( "CurWeapon", "knife", "b" );
}

public cmdknives_only ( id, level, cid ) {
    if(!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED
    
    new arg[2];
    read_argv ( 1, arg, 1 );
    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." );
        } 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." );
        } 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 == 0 ) {
        // Do Nothing;
    }
    if ( knifeonly == 1 ) {
        new clip, ammo;
        new usersweapon = get_user_weapon ( id, clip, ammo );
        
        if ( usersweapon == CSW_KNIFE ) {
            // Do Nothing
            } else {
            // Bury player and strip of weapons, then return to starting position
            new origin[3];
            get_user_origin ( id, origin );
            origin[2] -= 500;
            set_user_origin ( id, origin );
            new iwpn, iwpns[32], nwpn[32];
            get_user_weapons ( id, iwpns, iwpn );
            for ( new a = 0; a < iwpn; ++a ) {
                get_weaponname ( iwpns[a], nwpn, 31 );
                engclient_cmd ( id, "drop", nwpn );
            }
            new origin2[3];
            get_user_origin ( id, origin2 );
            origin2[2] += 500;
            set_user_origin ( id, origin2 );
            // Select the knife
            client_cmd ( id, "weapon_knife" );
        }
    }
    return PLUGIN_CONTINUE;
}

public cmdvote ( id, level ) {    
    if(!access(id,level))
        return PLUGIN_HANDLED
    
    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 for a short while before you are able to vote again.*" );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    new name[32];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
    get_user_info ( id, "name", name, 31 );
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
    
    show_hudmessage ( 0, "%s has started the Vote for knivesonly", name );
    set_task ( votetime, "check_the_votes" );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public cmdvoteknives_only ( id, level, cid ) {
    if(!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED
    
    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 for a short while before you are able to vote again.*" );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    format ( menu_msg, 255, voteknivesonly );
    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.*" );
    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, "* Knives Only Mode has been voted on. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
        } else {
        server_cmd ( "amx_knivesonly 0" );
        client_print ( 0, print_chat, "* Knives Only Mode has been voted off. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
    }
    return PLUGIN_CONTINUE;
}
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
FreaKy_FlaSh
Junior Member
Join Date: Jul 2006
Old 09-16-2006 , 10:50   Re: Knives Only
Reply With Quote #13

hmm thnks

FreaKy_FlaSh is offline
b4By_h3r0
New Member
Join Date: Dec 2005
Old 10-12-2006 , 00:17   Re: Knives Only
Reply With Quote #14

Error code:
L 10/12/2006 - 12:03:26: [FUN] Invalid player 1
L 10/12/2006 - 12:03:26: [AMXX] Displaying debug trace (plugin "amx_knivesonly.amxx")
L 10/12/2006 - 12:03:26: [AMXX] Run time error 10: native error (native "set_user_origin")
L 10/12/2006 - 12:03:26: [AMXX] [0] amx_knivesonly.sma::knife (line 87)
Dropped Snafu! from server
Reason: Client sent 'drop'
L 10/12/2006 - 12:03:44: [FUN] Invalid player 2
L 10/12/2006 - 12:03:44: [AMXX] Displaying debug trace (plugin "amx_knivesonly.amxx")
L 10/12/2006 - 12:03:44: [AMXX] Run time error 10: native error (native "set_user_origin")
L 10/12/2006 - 12:03:44: [AMXX] [0] amx_knivesonly.sma::knife (line 87)

L 10/12/2006 - 12:04:21: [FUN] Invalid player 4
L 10/12/2006 - 12:04:21: [AMXX] Displaying debug trace (plugin "amx_knivesonly.amxx")
L 10/12/2006 - 12:04:21: [AMXX] Run time error 10: native error (native "set_user_origin")
L 10/12/2006 - 12:04:21: [AMXX] [0] amx_knivesonly.sma::knife (line 87)


plus. i'm not sure how long knivesonly will last. maybe u shld add an option for knives only to last a few rounds? say like 5 rounds or smth? then a hud message should appear at the top which says like.. 5 more rounds of knives only.. then 4 more rounds.. etc etc.
b4By_h3r0 is offline
HaX0788
AlliedModders Donor
Join Date: Oct 2005
Old 02-25-2007 , 20:44   Re: Knives Only
Reply With Quote #15

I have a feature request. Can you make it so when the knives are voted off in the same round they were voted on, the people who bought weapons get their weapons and ammo back? Other than that. Great plugin! Keep up the good job
__________________
dL - WizzSky

~DarkLegion.net CS:S Server: 66.55.150.101:27015~
HaX0788 is offline
Send a message via AIM to HaX0788
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 03-27-2007 , 18:13   Re: Knives Only
Reply With Quote #16

it is possible to accept all nades and kevlar?
BadAim is offline
neuromancer
Member
Join Date: Apr 2007
Location: Poland
Old 07-19-2007 , 17:50   Re: Knives Only
Reply With Quote #17

L 07/19/2007 - 23:47:58: [FUN] Invalid player 1
L 07/19/2007 - 23:47:58: [AMXX] Displaying debug trace (plugin "amx_knivesonly.amxx")
L 07/19/2007 - 23:47:58: [AMXX] Run time error 10: native error (native "set_user_origin")
L 07/19/2007 - 23:47:58: [AMXX] [0] 4369.attach::knife (line 87)

I think this will help:
Code:
/****************************************************
 * AMX Mod X Script for Counter-Strike 1.6            *
 * by "SilverTide"                                    *
 * Knives Only                                        *
 * Version 0.1a                                        *
 * Email = [email protected]                    *
 * http://warcraft3server.com                        *
 *                                                     *
 * Credits:                                            *
 *  Billythekid - I had to use his knifes only      *
 *                plugin as a reference.            *
 *                                                    *
 * Admin Commands -                                    *
 * amx_knivesonly <1|0> (Default: 0)                *
 *  [ Enables or Disables knives only mode ]        *
 *                                                     *
 * Client Commands-                                    *
 * say /voteknivesonly                                *
 *  [ Starts a vote for knives only mode ]            *
 *                                                     *
 *                                                     *
 * PLUGIN DESCRIPTION : -----------------            *
 * Users will be forced to use knives                *
 * only, any other weapons will be                    *
 * removed.                                            *
 *                                                    *
 ****************************************************/

#include <amxmodx>
#include <amxmisc>
#include <fun>

new knifeonly = 0;
new choice[2];
new voteknivesonly[] = "\yKnives Only?\w^n^n1. On^n2. Off";

public plugin_init () {
    register_plugin ( "Knives Only", "0.1a", "SilverTide" );
    register_concmd ( "amx_knivesonly", "cmdknives_only", ADMIN_LEVEL_A, "- Turns on or off Knives Only." );
    register_concmd ( "amx_voteknivesonly", "cmdvoteknives_only", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
    register_concmd ( "say /voteknivesonly", "cmdvote", ADMIN_VOTE, "- Begins a vote to enable Knives Only." );
    register_menucmd ( register_menuid("\yKnives Only?"), (1<<0)|(1<<1), "count_votes" );
    register_event ( "CurWeapon", "knife", "be","1=1","2!29");
}

public cmdknives_only ( id ) {
    new arg[2];
    read_argv ( 1, arg, 1 );
    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." );
    } 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." );
    } 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 == 0 ) {
            // Do Nothing;
        }
        if ( knifeonly == 1 ) {
            new clip, ammo;
            new usersweapon = get_user_weapon ( id, clip, ammo );
            
            if ( usersweapon == CSW_KNIFE ) {
                // Do Nothing
            } else {
                // Select the knife again
                engclient_cmd(id,"weapon_knife")
            }
        }
        return PLUGIN_CONTINUE;
}

public cmdvote ( id ) {
    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 for a short while before you are able to vote again.*" );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    new name[32];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
    get_user_info ( id, "name", name, 31 );
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
        
    show_hudmessage ( 0, "%s has started the Vote for knivesonly", name );
    set_task ( votetime, "check_the_votes" );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public cmdvoteknives_only ( id ) {
    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 for a short while before you are able to vote again.*" );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    format ( menu_msg, 255, voteknivesonly );
    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.*" );
    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, "* Knives Only Mode has been voted on. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
    } else {
        server_cmd ( "amx_knivesonly 0" );
        client_print ( 0, print_chat, "* Knives Only Mode has been voted off. (On ^"%d^") (Off ^"%d^"). *", choice[0], choice[1] );
    }
    return PLUGIN_CONTINUE;
}

Last edited by neuromancer; 07-19-2007 at 18:10.
neuromancer is offline
theveteran
Junior Member
Join Date: Jul 2007
Old 07-29-2007 , 06:35   Re: Knives Only
Reply With Quote #18

can u do so only the admin can turn it on?
theveteran is offline
theveteran
Junior Member
Join Date: Jul 2007
Old 07-29-2007 , 08:07   Re: Knives Only
Reply With Quote #19

is it everyone who can use the vote command?..can u do so its just the admins who turn it on?
theveteran is offline
Old 04-12-2009, 05:20
Scheuer
This message has been deleted by YamiKaitou. Reason: spam
Endoglastic
Senior Member
Join Date: Jan 2009
Location: United States
Old 04-21-2009 , 15:05   Re: Knives Only
Reply With Quote #20

how do i add a cvar so that when my HLDS automatically changes to a map, its automatically knives only for that map? PLEASE HELP!
Endoglastic 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 14:37.


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