AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   [29/11/09] ScoutzKnivez Mod (https://forums.alliedmods.net/showthread.php?t=108593)

grimvh2 11-07-2009 07:40

[29/11/09] ScoutzKnivez Mod
 
1 Attachment(s)
ScoutzKnivez Mod
Credits :

Merciless : Request (Here)
Hunter-Digital : No Zoom Code
ConnerMcLeod : Improving / No Zoom Code
Kureno : Tester and my <3
xPaw : Optimizing


Information :

7different types to play scoutzknivez :
- Normal Mode
- Knife Mode (Knife Only)
- Scout Mode (Scout Only)
- No Zoom Mode (Scout Only + No Zoom)
- No Slash Mode (Knife Only + No Slash)
- One Hit Mode
- Hs Only Mode


Cvars :

Code:

"skm_enable" default :"1"
Information: Enables/disables the plugin

"skm_showmessage" default :"1"
Information: Enables/disables messages at round start

"skm_randomtype" default :"1"
Information :0= Keep the same type 1=Evry new round the type changes
2= Evry new round there is a random type

"skm_scoutgrav" default :"250"
Information :Scout Gravity

"skm_knifegrav" default :"200"
Information :Knife Gravity

"skm_forcestab" Default :"0"
Information :Force stab at no slash mode

"skm_knifehs" Default :"0"
Information :If hs mode only is activated, 1=Knife hs only , 0=You can kill with knife without hs.

"skm_normalmode" default :"1"
"skm_knifemode" default :"1"
"skm_scoutmode" default :"1"
"skm_nozoommode" default :"1"
"skm_noslashmode" default :"1"
"skm_onehitmode" default :"1"
"skm_hsonlymode" default :"1"
Information : Enables/Disabled modes

Commands :

say /skmod (ADMIN_KICK) : Opens the main menu.

Changelog :

Code:

Version 1.0 : Initial Release
Version 1.1 : Improving/Optimazing
Version 1.2 : Improving + added No Slash Mode
Version 1.3 : Added cvars + Rewrote Menu + Removed fakemeta_util
Version 1.4 : Added cvars + Added One Hit Mode + Fixed No Ammo Bug
Version 1.5 : Fixed bug (got stuck when you disabled the last mode)
Version 1.6 : Added headshot only mode.

Notes :
This plugin was made for the map scoutzknivez(It wont give scouts at round start. Maybe ill add this later)
New ideas/features are welcome.

ToDo List :
Add more types (Im thinking!!)




xPaw 11-07-2009 08:23

Re: [07/11/09] Sk Mod
 
  • Include <fun> and use give_item instead of fakemeta_util
  • You can generate menu in plugin_init, store it in global variable, and then show to clients (but dont forge to remove menu_destroy lines)
  • PHP Code:

        if(get_pcvar_num(cvar_random) == 1)
        {
            if(
    Type == 6)
                
    nType=0;
            else
                
    nType+=2;
        }
        else if(
    get_pcvar_num(cvar_random) == 2)
        {
            new 
    num random_num(1,4)
            switch(
    num)
            {
                case 
    1:nType=0;
                case 
    2:nType=2;
                case 
    3:nType=4;
                case 
    4:nType=6;
            }
        } 

    • Use switch for cvar.
    • You can directly do switch( random_num( 1, 4 ) )

Jeroen2355 11-07-2009 08:30

Re: [07/11/09] Sk Mod
 
Nice Plugin :)

grimvh2 11-07-2009 08:36

Re: [07/11/09] Sk Mod
 
Quote:

Originally Posted by xPaw (Post 983036)
  • You can generate menu in plugin_init, store it in global variable, and then show to clients (but dont forge to remove menu_destroy lines)

Does this have any advantage?
Thx for feedback

xPaw 11-07-2009 08:37

Re: [07/11/09] Sk Mod
 
Sure it is, you wont always generate the menu, so it will also save natives calling and blabla...

ConnorMcLeod 11-07-2009 08:50

Re: [07/11/09] Sk Mod
 
You forgot the alive check in CurWeapon register line, + filter arg 1 == 1

grimvh2 11-07-2009 08:57

Re: [07/11/09] Sk Mod
 
Quote:

Originally Posted by ConnorMcLeod (Post 983066)
filter arg 1 == 1

?? where ?

xPaw 11-07-2009 09:04

Re: [07/11/09] Sk Mod
 
Probably here
register_event("CurWeapon", "Weap_Switch", "b", "1=1" );

grimvh2 11-07-2009 09:06

Re: [07/11/09] Sk Mod
 
Quote:

Originally Posted by xPaw (Post 983077)
Probably here
register_event("CurWeapon", "Weap_Switch", "b", "1=1" );

ah, I dind knew that :p

ConnorMcLeod 11-07-2009 09:15

Re: [07/11/09] Sk Mod
 
+ flag "e" aka player is alive, so you don't have to check it later in the code :

register_event("CurWeapon", "Weap_Switch", "be", "1=1" );


All times are GMT -4. The time now is 06:28.

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