AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   CSDM Style Gun Menu (https://forums.alliedmods.net/showthread.php?t=167709)

Doc-Holiday 09-19-2011 02:57

CSDM Style Gun Menu
 
2 Attachment(s)
CSDM Style Gun Menu
Version 0.0.9


Description:
For cz bot support Click Here. This was a request from Apollyon.
  • Simple gun menu with CSDM like options
  • Full Load-Out capability
  • Blocks Buyzones
  • Fully Customizable.
  • Options for unlimited ammo, Grenades, NVG's, armor.
  • Option to block Weapon Drops (Users cant use client command "drop")
  • Customizable Weapons list for Primary and Secondary weapons
  • Defuse Kits on bomb Maps
  • Optional strip (keep or remove the bomb)
  • Customizable Menu Titles

Installation:
  • Place the .txt files into addons/amxmodx/configs folder
  • Place the .amxx into addons/amxmodx/plugins folder
  • Add CSDM_Style_Gun_Menu.amxx to the bottom of your plugins.ini
  • Load the game up and play with the menu.
Cvars:
  • wm_mainmenutitle <Weapons Menu> - Main Menu Title
  • wm_primenutitle <Primary Weapons> - Primary Weapon Title
  • wm_secmenutitle <Secondary Weapons> - Secondary Weapon Title
  • amx_prefix_name <WM> - Chat Prefix (Plugin text)
  • wm_switch <1> - Turns plugin on and off. 0 = off
  • wm_blockdrop <1> - Blocks weapon drop. 0 = off
  • wm_henade <1> - Give HE nade? 0 = off
  • wm_flash <2> - Give Flash? 0 = off (number = amount given)
  • wm_smoke <1> - Give Smoke? 0 = off (number = amount given)
  • wm_armor <100> - Armor Amount. 100 = Vest Helm 100 value
  • wm_nvg <1> - Give NVGs? 0 = off
  • wm_unlimitedammo <1> - Unlimited Ammo? 0 = off
  • wm_stripmode <1> - Strip Mode. 1 = Strip and keep bomb. 2 = Strip everything including bomb.
  • wm_teammode <0> - Team For Gun Menu. 0 = Both, 1 = T Only, 2 = CT Only.
  • wm_fastswitch <1> - Fast switch on grenade throw 1 = switch to previous weapon 0 = dont switch
  • wm_czbotsupport <0> - CZ Bot Support (Requires Rage Module) 1 = cz support 0 = none
Commands:
  • amx_teammode <value> - The value to set the team. 0 = both teams get menu. 1 = T only. 2 = CT only
  • wmadminmenu- brings up the admin menu for the plugin (reuqires ADMIN_RCON)
  • say wmadmin - brings up the admin menu for the plugin (reuqires ADMIN_RCON)

Client Commands: Can be used in say and say_team
  • /guns, guns - Re-enables Gun Menu
Credits:
  • CSDM Dev Team - CSDM Gun Menu.
  • Connor - Fixing my buy zone blocker
  • Emp`- Array*String instead of Array*Array
Note: To alter the weapons list view the "DM_WeaponOrder.ini". Simply add a ';' in front of the line to disable that weapon. More detailed instructions located at the top of the file.

Weapon names are not case or space sensitive. However it needs to match the 'weapon_' name.
For Example:
weapon_glock18

the text in file can be written any of the following ways
Glock 18, GLOCK 18, glock 18, GlOcK 18, G l O c K 1 8

Change log:
0.0.1
First Beta Release
0.0.2
Bug Fixes:
  • Bomb defusers given to T's
  • Logic Errors
Removed dual file weapons list.
0.0.3
Minor bug fixes
Added a ton of comments.
0.0.4
Added Setting to allow you to select which team.
Small Bug fix.
0.0.5
Fixed bug for team specific menu/buyzone block. Thanks to conor.
Small Bug fixes.
Removed the green shopping cart when you don't have a buyzone.
Added a command to change the team that gets the menu. (restarts the round for you)
Now supports multiple he grenades.
0.0.6
[SIZE=2]Now has a menu to change the team that gets the menu also.
Once you are done selecting the team T,CT, or both. you must select the option Save and Exit.
0.0.7
New Cvar added check above.
Fixed runtime error for give_item

0.0.8
Fixed bot support. If you want to use this with cz bots. it requires the rage module and this rage addon
0.0.9
Fixed Linux Support
Added a cvar: wm_czbotsupport <Default: 0>

Doc-Holiday 09-19-2011 17:33

Re: CSDM Style Gun Menu
 
FIRST UPDATE YAY!!!!!

0.0.2
Bug Fixes:
  • Bomb defusers given to T's
  • Logic Errors
Removed dual file weapons list.

To enable a specific weapon remove the semicolon at the front of the weapon name.
To disable a specific weapon place a semicolon.

ANTICHRISTUS 09-19-2011 18:46

Re: CSDM Style Gun Menu
 
If I understood, this is like CSDM but without respawning ?
it gives the CSDM features with cvars, yeah good idea http://illiweb.com/fa/i/smiles/icon_smile.gif.

Doc-Holiday 09-19-2011 19:24

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by ANTICHRISTUS (Post 1559068)
If I understood, this is like CSDM but without respawning ?
it gives the CSDM features with cvars, yeah good idea http://illiweb.com/fa/i/smiles/icon_smile.gif.

Its just a gun menu with some added features Apo wanted it to create his own style of CSDM with out the big bulky restricted CSDM

XINLEI 09-19-2011 21:36

Re: CSDM Style Gun Menu
 
Can you set a custom price for each weapon?

would be awesome.

Doc-Holiday 09-19-2011 21:43

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by XINLEI (Post 1559143)
Can you set a custom price for each weapon?

would be awesome.

I believe conor already has a weapon price modifier but that is a different plugin then what this is for.

(Doesn't cost the player money. just gives the guns like CSDM)

XINLEI 09-19-2011 22:13

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1559151)
I believe conor already has a weapon price modifier but that is a different plugin then what this is for.

(Doesn't cost the player money. just gives the guns like CSDM)

well, i've asked this since that feature as never been on a custom buymenu.
can you add it or link me the connor's plugin?

Thanks in advance.

Doc-Holiday 09-19-2011 22:28

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by XINLEI (Post 1559157)
well, i've asked this since that feature as never been on a custom buymenu.
can you add it or link me the connor's plugin?

Thanks in advance.

i lied it was arkshine
https://forums.alliedmods.net/showpo...1&postcount=53

Fedde 09-19-2011 23:59

Re: CSDM Style Gun Menu
 
I must to change the map when I use this plugin,to disable the map objetive?

-btw-
Good job;)

Doc-Holiday 09-20-2011 00:03

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Fedde (Post 1559201)
I must to change the map when I use this plugin,to disable the map objetive?

-btw-
Good job;)

I dont remove objectives just an option to remove the bomb. and the cvar can be changed on the fly but will take effect after the next spawn(when it stripps)


and thanks!

modernwarfare 09-20-2011 01:24

Re: CSDM Style Gun Menu
 
good job needed this when i first made my plugin

but not needed any more

but good job

Doc-Holiday 09-20-2011 01:44

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by modernwarfare (Post 1559228)
good job needed this when i first made my plugin

but not needed any more

but good job

personally i like this one its easier to use and offers a bit more and a lot easier to customize.. the one your using by kronic i believe is a bit harder to alter the order of the weapons if the end user wants to remove or alter the order since almost all of it is hard coded.

Feel free to use the one here. (just add the correct credits and we dont care) :)

Doc-Holiday 09-20-2011 05:48

Re: CSDM Style Gun Menu
 
Small update.

THC 09-26-2011 15:32

Re: CSDM Style Gun Menu
 
Hi Nice i just want to ask if i need to remove the csdm_equip to add yours

modernwarfare 09-26-2011 15:47

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1559314)
Small update.


if this is better i would use

but can you do so the ini file is not needed?

ANTICHRISTUS 09-26-2011 15:50

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by THC (Post 1563742)
Hi Nice i just want to ask if i need to remove the csdm_equip to add yours

this plugin is not for CSDM, it's just imitating it with the same buy menu, for non-CSDM mods.

THC 09-26-2011 15:56

Re: CSDM Style Gun Menu
 
how its not for csdm when its got this name CSDM Style Gun Menu ?

ANTICHRISTUS 09-26-2011 16:03

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by THC (Post 1563754)
how its not for csdm when its got this name CSDM Style Gun Menu ?

it's just a menu which imitates CSDM.
Quote:

Originally Posted by Doc-Holiday (Post 1559092)
Its just a gun menu with some added features Apo wanted it to create his own style of CSDM with out the big bulky restricted CSDM


joshknifer 09-26-2011 18:51

Re: CSDM Style Gun Menu
 
did anybody else have problems with the sma file code being all jumbled?

Doc-Holiday 09-27-2011 01:09

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by joshknifer (Post 1563848)
did anybody else have problems with the sma file code being all jumbled?

Download the file directly to your folder then view it there sometimes different applications you use to view the file will erase the format.

As to answer the above questions about using it with CSDM i havn't tried it so use it at your own risk..

This is not meant to replace bails hard work on the menu but to allow you to create your own mods for servers using your creativity.

Since there hasn't been any "good" gun menus i thought i would release this one which allows you to create mods such as 'Custom Deathmatch' gameplay

modernwarfare 09-27-2011 02:00

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1563950)
Download the file directly to your folder then view it there sometimes different applications you use to view the file will erase the format.

As to answer the above questions about using it with CSDM i havn't tried it so use it at your own risk..

This is not meant to replace bails hard work on the menu but to allow you to create your own mods for servers using your creativity.

Since there hasn't been any "good" gun menus i thought i would release this one which allows you to create mods such as 'Custom Deathmatch' gameplay

if this is better i would use

but can you do so the ini file is not needed?

HardZone 09-27-2011 05:54

Re: CSDM Style Gun Menu
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define OFFSET_PRIMARYWEAPON 116
#define OFFSET_C4_SLOT 372
#define fm_cs_set_user_nobuy(%1)    set_pdata_int(%1, 235, get_pdata_int(%1, 235) & ~(1<<0))
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

enum _:CHOICES
{
    
OPTION_NONEOPTION_NEWOPTION_OLDOPTION_SAVE
}

new const 
g_szOptions[][] =
{
    
"None""New Guns""Previous Guns""Previous + Save"
}

new 
g_WeaponBPAmmo[] =
{
    
052090132110090112010010090909010012030,
    
12020032901209023590900100
};

new 
g_WeaponSlots[] =
{
    
02014151142211112211111114,
    
21131
};

new 
g_szWepFile[256], g_FilePointer;
new 
g_pWeaponMenug_sWeaponMenug_SpawnMenu;
new 
g_bSave[33], g_ipPreviousWeapons[33], g_isPreviousWeapons[33];
new Array:
g_PrimaryWeapons, Array:g_SecondaryWeapons;
new 
g_MainMenuTitleg_PrimaryMenuTitleg_SecondaryMenuTitleg_PluginPrefixg_iToggleg_iBlockDropg_iHENadeg_iFlashg_iSmokeg_iArmorAmountg_iNVGg_iUnlimitedAmmog_iStripMode;
new 
g_szMainMenuTitle[32], g_szPriMenuTitle[32], g_szSecMenuTitle[32], g_szPrefixName[32];
new 
bool:g_bomb_targ;

new 
gCommands[][] = 
{
    
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47"
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"sgren""defuser""nvgs""shield""primammo""secammo""km45""9x19mm""nighthawk""228compact""12gauge",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2""buy"
}

public 
plugin_init()
{
    
register_plugin("Weapon Menu""0.0.3""SavSin");
    
    
g_MainMenuTitle register_cvar("wm_mainmenutitle""Weapons Menu"); //Main Menu Title Cvar
    
g_PrimaryMenuTitle register_cvar("wm_primenutitle""Primary Weapons"); //Primary Weapons Menu Title Cvar
    
g_SecondaryMenuTitle register_cvar("wm_secmenutitle""Secondary Weapons"); //Secondary Weapons Menu Title Cvar
    
g_PluginPrefix register_cvar("amx_prefix_name""WM"); //Prefix Name Cvar
    
    
g_iToggle register_cvar("wm_switch""1"); //Turns plugin on and off
    
g_iBlockDrop register_cvar("wm_blockdrop""1"); //Blocks weapon drop
    
g_iHENade register_cvar("wm_henade""2"); // Amount of HE Nades given to each player
    
g_iFlash register_cvar("wm_flash""2"); //Amount of Flash Nades given to each player
    
g_iSmoke register_cvar("wm_smoke""2"); //Amount of Smoke Nades given to each player
    
g_iArmorAmount register_cvar("wm_armor""100"); //Amount of Armor Given to each player
    
g_iNVG register_cvar("wm_nvg""1"); //Give NVG's?
    
g_iUnlimitedAmmo register_cvar("wm_unlimitedammo""1"); //Allow Unlimited ammo?
    
g_iStripMode register_cvar("wm_stripmode""1"); //1 = Strip and keep bomb  2 = Strip All
    
    
register_event("CurWeapon""eCurWeapon""be""1=1"); //Unlimited ammo
    
    
get_pcvar_string(g_MainMenuTitleg_szMainMenuTitlecharsmax(g_szMainMenuTitle)); //Main Menu Title Text
    
get_pcvar_string(g_PrimaryMenuTitleg_szPriMenuTitlecharsmax(g_szPriMenuTitle)); // Primary Menu Title Text
    
get_pcvar_string(g_SecondaryMenuTitleg_szSecMenuTitlecharsmax(g_szSecMenuTitle)); //Secondary Menu Title Text
    
get_pcvar_string(g_PluginPrefixg_szPrefixNamecharsmax(g_szPrefixName)); //Prefix Name shows infront of plugin chat.
    
    
RegisterHam(Ham_Spawn"player""fwdPlayerSpawn"1); //Player Spawn Post
    
register_clcmd("say /guns""cmdGuns"); //Re-Enables Gun menu
    
register_clcmd("say guns""cmdGuns"); //Re-Enables Gun menu
    
register_clcmd("say_team /guns""cmdGuns"); //Re-Enables Gun menu
    
register_clcmd("say_team guns""cmdGuns"); //Re-Enables Gun menu
    
register_clcmd("drop""blockDrop"); //Re-Enables Gun menu
    
    
for (new isizeof gCommandsi++)
        
register_clcmd(gCommands[i], "cmdGuns")
    
    
CreateWeaponsArray(); //Create the menus and arrays
    
    
new szNum[3];
    
g_SpawnMenu menu_create(g_szMainMenuTitle"HandleSpawnMenu"); //Create Main Menu
    
    
for(new 1sizeof(g_szOptions); i++) //Loop through all the options
    
{
        
num_to_str(iszNumcharsmax(szNum));
        
menu_additem(g_SpawnMenug_szOptions[i], szNum0); //Add the options to the menu
    
}
    
    
menu_setprop(g_SpawnMenu MPROP_EXIT MEXIT_NEVER); //Dont allow Menu to exit
    
    
if (fm_find_ent_by_class(-1"func_bomb_target") || fm_find_ent_by_class(-1"info_bomb_target")) //Checks for bombsites
    
{
        
g_bomb_targ true//If there is a bomb site Set this to true
    
}
}

public 
plugin_cfg()
{
    
register_message(get_user_msgid("StatusIcon") , "Message_StatusIcon"); //Message for BuyZone
}

public 
Message_StatusIcon(iMsgIdMSG_DESTid)
{
    if(!
get_pcvar_num(g_iToggle))
        return 
PLUGIN_HANDLED;
    static 
szIcon[5];
    
get_msg_arg_string(2szIcon4);
    if(
szIcon[0] == 'b' && szIcon[2] == 'y' && szIcon[3] == 'z')
    {
        if(
get_msg_arg_int(1))
        {
            
fm_cs_set_user_nobuy(id); //Block BuyZone
            
return PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
cmdGuns(id//Renable Guns Menu
{
    if(
get_pcvar_num(g_iToggle) && g_bSave[id])
    {
        
g_bSave[id] = false;
        
client_print(idprint_chat"[%s] Gun menu will be re-enabled next spawn"g_szPrefixName);
    }
}

public 
fwdPlayerSpawn(id)
{
    if(
is_user_alive(id) && get_pcvar_num(g_iToggle)) //Check if player alive and plugin is active
    
{
        switch(
get_pcvar_num(g_iStripMode))
        {
            case 
1:    //Strip and keep bomb
            
{
                
StripUserWeapons(id); //Calls the Strip Function
            
}
            case 
2// Strip Everything
            
{
                
strip_user_weapons(id); //Fun native to strip ALL weapons
                
give_item(id"weapon_knife"); //Fun native to give the knife back
            
}
        }
        if(
g_bomb_targ && get_pcvar_num(g_iStripMode) == && cs_get_user_team(id) == CS_TEAM_CT)
        {
            
cs_set_user_defuse(id1); //If there is a bomb site and your a CT give you a Defuse kit
        
}
        
        if(
get_pcvar_num(g_iHENade)) //Check if Grenades are enabled
        
{
            
//g_HeNadesLeft[id] = get_pcvar_num(g_iHENade);
            //Gives player the right amount of grenades
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_FLASHBANGget_pcvar_num(g_iHENade));
        }
        if(
get_pcvar_num(g_iFlash)) //Checks if Flashbangs are enabled
        
{
            
//Gives player the correct amount of flashbangs
            
give_item(id"weapon_flashbang");
            
cs_set_user_bpammo(idCSW_FLASHBANGget_pcvar_num(g_iFlash));
        }
        if(
get_pcvar_num(g_iSmoke)) //Checks if smoke is enabled
        
{
            
//Gives Player the correct amount of Smoke Grenades
            
give_item(id"weapon_smokegrenade");
            
cs_set_user_bpammo(idCSW_SMOKEGRENADEget_pcvar_num(g_iSmoke));
        }
        
        
//Gives the player the amount of armor based on the cvar above.
        
cs_set_user_armor(idget_pcvar_num(g_iArmorAmount), CS_ARMOR_VESTHELM);
        
        if(
get_pcvar_num(g_iNVG)) //Night Vision enabled?
        
{
            
cs_set_user_nvg(id1); //Gives the user night vision
        
}
        
        if(!
g_bSave[id]) //Checks weather you have saved your previous weapons or not.
        
{
            
menu_display(idg_SpawnMenu); //Shows the menu if you havn't saved your previous
        
}
        else
        {
            
PreviousWeapons(id); //Gives you the weapons you saved in from the menu
        
}
    }
}

public 
eCurWeapon(id)
{
    if(!
get_pcvar_num(g_iToggle) || !get_pcvar_num(g_iUnlimitedAmmo))
        return 
PLUGIN_HANDLED;
    
    new 
iWeapon read_data(2); //Gets current Weapon ID CSW weapon constraints
    
    
if(g_WeaponSlots[iWeapon] == || g_WeaponSlots[iWeapon] == 2)
    {
        if(
cs_get_user_bpammo(idiWeapon) < g_WeaponBPAmmo[iWeapon])
        {
            
cs_set_user_bpammo(idiWeapong_WeaponBPAmmo[iWeapon]); //If your bp ammo is lower then the max then set it to the max
        
}
    }
    return 
PLUGIN_CONTINUE;
}

public 
blockDrop(id//Blocks weapon drop
{
    if(
get_pcvar_num(g_iBlockDrop) && get_user_weapon(id) != CSW_C4)
    {
        
client_print(idprint_center"You are not allowed to drop your weapons.");
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}

public 
HandleSpawnMenu(idiMenuiItem)
{
    new 
szKey[3], Dummy;
    
menu_item_getinfo(iMenuiItemDummyszKey2""0Dummy); //Gets the selection off the menu
    
    
switch(str_to_num(szKey))
    {
        case 
OPTION_NEW:
        {
            
menu_display(idg_pWeaponMenu); //Displays primary weapons menu
        
}
        case 
OPTION_OLD
        {
            
PreviousWeapons(id); //Gives your previous weapons
        
}
        case 
OPTION_SAVE:
        {
            
PreviousWeapons(id); //Same as OPTION_OLD but saves it so you get these weapons each spawn.
            
g_bSave[id] = true;
            
client_print(idprint_chat"[%s] say /guns to re-enable the gun menu."g_szPrefixName);
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
PreviousWeapons(id//Access the array to give you the previous weapons used by you.
{
    new 
szpData[32], szsData[32];
    
ArrayGetString(g_PrimaryWeaponsg_ipPreviousWeapons[id], szpDatacharsmax(szpData)); //Gets the array item of your previous primary weapon
    
ArrayGetString(g_SecondaryWeaponsg_isPreviousWeapons[id], szsDatacharsmax(szsData)); //Gets the array item of your previous secondary weapon
    
strtolower(szpData); //Converts it all to lower case
    
strtolower(szsData); //Converts it all to lower case
    
replace_all(szpDatacharsmax(szpData), " """); //Removes spaces from the array text.
    
replace_all(szsDatacharsmax(szsData), " """); //Removes spaces from the array text.
    
format(szpDatacharsmax(szpData), "weapon_%s"szpData); //adds weapon_ infront of the array text.
    
format(szsDatacharsmax(szsData), "weapon_%s"szsData);//adds weapon_ infront of the array text.
    
GiveWeapons(idszpData); //Gives player previous primary weapon
    
GiveWeapons(idszsData); //Gives player previous Secondary Weapon
}

public 
CreateWeaponsArray()
{
    
get_configsdir(g_szWepFilecharsmax(g_szWepFile));  //gets addons/amxmodx/configs directory
    
format(g_szWepFilecharsmax(g_szWepFile), "%s/DM_WeaponOrder.ini"g_szWepFile); //formats the file name for the Weapons order INI
    
g_FilePointer fopen(g_szWepFile"r"); //Opens the file
    //Arrays
    
g_PrimaryWeapons ArrayCreate(15); //Creates the Primary Weapons Array
    
g_SecondaryWeapons ArrayCreate(15); //Creates the Secondary Weapons Array
    
    //Weapon Menus
    
g_pWeaponMenu menu_create(g_szPriMenuTitle"HandlePrimaryWeapons"); //Creates the Primary Weapon Menu
    
g_sWeaponMenu menu_create(g_szSecMenuTitle"HandleSecondaryWeapons"); //Creates the Secondary Weapon Menu
    
    
new szData[32], szWeaponName[32], szpNum[3], szsNum[3];
    new 
pCountersCounter;
    if(
g_FilePointer//Makes sure the files open
    
{
        while(!
feof(g_FilePointer))
        {
            
fgets(g_FilePointerszDatacharsmax(szData)); //Reads a line of the file
            
trim(szData); //Removes '^n' new line character from the end of the line
            
if(containi(szData";") != -1//Checks to see if its a comment and then ignores it
                
continue;
            
//Check Weapon Slot for Menu Placement
            
copy(szWeaponNamecharsmax(szWeaponName), szData); //Copys the file data into a new variable to alter it
            
replace_all(szWeaponNamecharsmax(szWeaponName), " """); //Removes Spaces from the Text
            
format(szWeaponNamecharsmax(szWeaponName), "weapon_%s"szWeaponName); //Adds Weapon_ to the text
            
strtolower(szWeaponName); //converts the whole thing to lower case
            
new iWeaponID get_weaponid(szWeaponName); //Gets the CSW weapon constraint for that weapon
            
            
switch(g_WeaponSlots[iWeaponID]) //Checks which slot the weapon is for
            
{
                case 
1//Primary Slot
                
{
                    
ArrayPushString(g_PrimaryWeaponsszData); //Adds the original text to the array
                    
num_to_str(pCounterszpNumcharsmax(szpNum));
                    
menu_additem(g_pWeaponMenuszDataszpNum0); //Adds item to the primary weapons menu
                    
++pCounter;
                }
                case 
2//Secondary Slot
                
{
                    
ArrayPushString(g_SecondaryWeaponsszData); //Adds the original text to the array
                    
num_to_str(sCounterszsNumcharsmax(szsNum));
                    
menu_additem(g_sWeaponMenuszDataszsNum0);//Adds item to the Secondary Weapons Menu
                    
++sCounter;
                }
            }
        }
    }
    
//Blocks exit for both primary and secondary menus
    
menu_setprop(g_pWeaponMenu MPROP_EXIT MEXIT_NEVER);
    
menu_setprop(g_sWeaponMenu MPROP_EXIT MEXIT_NEVER);
    
    
fclose(g_FilePointer); //Closes the file
}

public 
HandlePrimaryWeapons(idiMenuiItem)
{
    new 
szKey[3], iSelectedWeaponDummy;
    
menu_item_getinfo(iMenuiItemDummyszKey2""0Dummy); //Gets the primary weapon selected.
    
    
iSelectedWeapon str_to_num(szKey);
    
g_ipPreviousWeapons[id] = iSelectedWeapon//Stores the selected weapon for option 2 and 3 on the main menu
    
    
new WeaponName[32], szArrayData[32];
    
ArrayGetString(g_PrimaryWeaponsiSelectedWeaponszArrayDatacharsmax(szArrayData)); //Gets the weapon name from the array
    
replace_all(szArrayDatacharsmax(szArrayData), " """); //removes the spaces
    
format(WeaponNamecharsmax(WeaponName), "weapon_%s"szArrayData); //adds weapon_ to the weapon name
    
strtolower(WeaponName);//Converts all to lower case
    
GiveWeapons(idWeaponName); //Gives primary weapon
    
    
menu_display(idg_sWeaponMenu); //Displays secondary weapons menu
}

public 
HandleSecondaryWeapons(idiMenuiItem)
{
    new 
szKey[3], iSelectedWeaponDummy;
    
menu_item_getinfo(iMenuiItemDummyszKey2""0Dummy); //Gets the secondary weapon selected
    
    
iSelectedWeapon str_to_num(szKey);
    
g_isPreviousWeapons[id] = iSelectedWeapon//Stores the selected weapon for option 2 and 3 on the main menu
    
    
new WeaponName[32], szArrayData[32];
    
ArrayGetString(g_SecondaryWeaponsiSelectedWeaponszArrayDatacharsmax(szArrayData)); //Gets the weapon name from the array
    
replace_all(szArrayDatacharsmax(szArrayData), " """); //removes the spaces
    
format(WeaponNamecharsmax(WeaponName), "weapon_%s"szArrayData); //adds weapon_ to the weapon name
    
strtolower(WeaponName);//Converts all to lower case
    
GiveWeapons(idWeaponName); //Gives secondary weapon
}

public 
grenade_throw(id greindex wId//When a grenade is thrown switch to last inv automatically
{
    
client_cmd(id"lastinv");
}

stock GiveWeapons(idszWeapon[])
{
    new 
iWeaponId get_weaponid(szWeapon); //Get the weapon id of the weapon given
    
give_item(idszWeapon); //Give the weapon
    
cs_set_user_bpammo(idiWeaponIdg_WeaponBPAmmo[iWeaponId]); //Set the ammo to max ammo
}

stock StripUserWeapons(id)
{
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT); //Gets the slot for C4
    
    
if( iC4Ent //If you have the C4
    
{
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT); //Remove it
    
}
    
    
strip_user_weapons(id); //Strip User weapons
    
give_item(id"weapon_knife"); //Give the knife
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0); //Set primary weapon offset to 0
    
    
if( iC4Ent //if you had the c4
    
{
        
set_pev(idpev_weaponspev(idpev_weapons) | (1<<CSW_C4)); //Give it back
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent); //Set the offset back to normal
        
cs_set_user_bpammo(idCSW_C41); //Give the backpack
        
cs_set_user_plant(id1); //Allow user to plant it
    
}
    return 
PLUGIN_HANDLED;
}
//End of plugin 

Updated Code With:

PHP Code:

new gCommands[][] = 
{
    
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47"
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"sgren""defuser""nvgs""shield""primammo""secammo""km45""9x19mm""nighthawk""228compact""12gauge",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2""buy"


You should add this to your plugin :)

Doc-Holiday 09-27-2011 14:18

Re: CSDM Style Gun Menu
 
The ini filie is why this is so great.... it allows 100% customizeability.. i will not remove the ini file... and please dont post code that isnt mine in my plugin thread....

If you want to remove the ini file create your own gun menu...

modernwarfare 09-27-2011 15:56

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1564240)
The ini filie is why this is so great.... it allows 100% customizeability.. i will not remove the ini file... and please dont post code that isnt mine in my plugin thread....

If you want to remove the ini file create your own gun menu...


ok thx for that

i have already one but it was so bad

but now i updated it much better :)

XINLEI 09-28-2011 10:36

Re: CSDM Style Gun Menu
 
i still keep my request of removing some money when you get a weapon, it will improve the plugin making it better than the other ones over here.

Doc-Holiday 09-28-2011 15:38

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by XINLEI (Post 1564753)
i still keep my request of removing some money when you get a weapon, it will improve the plugin making it better than the other ones over here.

Maybe ill add in an option via cvar but its not really what this plugin is supposed to do.

Doc-Holiday 10-02-2011 18:13

Re: CSDM Style Gun Menu
 
Per request via PM..

The guns menu now allows you to specify which team gets the menu.

0.0.4
Added Setting to allow you to select which team.
Small Bug fix.

Doc-Holiday 10-17-2011 02:22

Re: CSDM Style Gun Menu
 
UPDATE!!!!!!!

0.0.5
Fixed bug for team specific menu/buyzone block. Thanks to conor.
Small Bug fixes.
Removed the green shopping cart when you don't have a buyzone.
Added a command to change the team that gets the menu. (restarts the round for you)
Now supports multiple he grenades.

Doc-Holiday 10-20-2011 17:12

Re: CSDM Style Gun Menu
 
UPDATE!

0.0.6
Now has a menu to change the team that gets the menu also.
Once you are done selecting the team T,CT, or both. you must select the option Save and Exit.

joshknifer 11-09-2011 15:44

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1580028)
UPDATE!

0.0.6
Now has a menu to change the team that gets the menu also.
Once you are done selecting the team T,CT, or both. you must select the option Save and Exit.

Great option to add. Nice job :up:

Doc-Holiday 11-09-2011 18:03

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by joshknifer (Post 1593497)
Great option to add. Nice job :up:

Thanks i will also be adding in a method of Adding/Removing weapons from the list. Just not sure how i want to do that yet. Aswell as adding in a price system.

lqlqlq 11-19-2011 05:19

Re: CSDM Style Gun Menu
 
L 11/08/2011 - 22:07:44: [AMXX] Run time error 10 (plugin "CSDM_Style_Gun_Menu.amxx") (native "give_item") - debug not enabled!
L 11/08/2011 - 22:07:44: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Doc-Holiday 12-16-2011 17:34

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by lqlqlq (Post 1598976)
L 11/08/2011 - 22:07:44: [AMXX] Run time error 10 (plugin "CSDM_Style_Gun_Menu.amxx") (native "give_item") - debug not enabled!
L 11/08/2011 - 22:07:44: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Enable dbug and give me the read out i cant recreate this issue. plugin is running fine on my Custom Deathmatch server.

eforie 12-18-2011 08:37

Re: CSDM Style Gun Menu
 
good job ! i test it on my server, works great!

Doc-Holiday 12-18-2011 16:07

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by eforie (Post 1615234)
good job ! i test it on my server, works great!


Thanks after 4 days i was able to recreate the run time error... not sure exactly what it is.. It is most likely me missing a check before giving weapons

Apollyon 01-11-2012 22:08

Re: CSDM Style Gun Menu
 
I'm using this plugin for my custom Deathmatch server (not using CSDM at all). It works great!

Doc-Holiday 01-21-2012 13:37

Quote:

Originally Posted by Apollyon (Post 1629861)
I'm using this plugin for my custom Deathmatch server (not using CSDM at all). It works great!

Thanks. Will be updating to use tries and prices. Should be a day or two.

pacheco 01-21-2012 13:46

Re: CSDM Style Gun Menu
 
This plugins is really nice. Usefull for servers with custom Deathmatch! Nice Doc-Holiday =)

Anonymous 01-26-2012 22:41

Re: CSDM Style Gun Menu
 
can you add a cvar to make it so only admins spawn with the menu?

Doc-Holiday 01-27-2012 19:21

Re: CSDM Style Gun Menu
 
Quote:

Originally Posted by Anonymous (Post 1639012)
can you add a cvar to make it so only admins spawn with the menu?


lol.... Umm.. im currently recoding alot of this stuff so i will mess around with it and see what i can come up with.


All times are GMT -4. The time now is 07:00.

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