[ Cerere Plugin ] Meniu Arme RESPAWN [rezolvat]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
(c) WaRninG.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 261
Joined: 13 Jul 2018, 14:44
Detinator Steam: Da
Detinator server CS: 《ZP.PLAYARENA.RO 》
SteamID: Andu
Reputatie: Utilizator neserios (tepar!)
Membru Club eXtreamCS (4 Ian - 4 Mai)
Nick anterior: Andrei # QualTech
-1 avertisment (2 luni club)
Fond eXtream: 0
Location: Câmpulung
Has thanked: 3 times
Contact:

29 Aug 2018, 18:09

Salut, doresc si eu un plugin de genul [ Mai jos poze ] Se poate? :)


Image

Image

Image
Last edited by micleanu on 17 May 2020, 13:47, edited 1 time in total.
Reason: marcat ca rezolvat
User avatar
OnLyYoNuTz
Membru, skill +1
Membru, skill +1
Posts: 138
Joined: 18 Jun 2015, 18:51
Detinator Steam: Da
CS Status: Angent vânzări.
Detinator server CS: No
Fond eXtream: 0
Location: Suceava
Has thanked: 1 time

30 Aug 2018, 13:40

numai cu cersitu umblati, poate fodatoru a scos niste bani din buzunar pentru acel plugin si tu il vrei pe degeaba.
User avatar
(c) WaRninG.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 261
Joined: 13 Jul 2018, 14:44
Detinator Steam: Da
Detinator server CS: 《ZP.PLAYARENA.RO 》
SteamID: Andu
Reputatie: Utilizator neserios (tepar!)
Membru Club eXtreamCS (4 Ian - 4 Mai)
Nick anterior: Andrei # QualTech
-1 avertisment (2 luni club)
Fond eXtream: 0
Location: Câmpulung
Has thanked: 3 times
Contact:

30 Aug 2018, 13:51

Eu il numesc "Ajutor" si daca vrea cineva sa il dea, il da. Nu il da obligat sau etc, asa ca nu te mai baga.
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2548
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 61 times
Contact:

30 Aug 2018, 15:18

Netestat.
csdm.cfg - locatie [ addons/amxmodx/configs | Afiseaza codul
][code];CSDM Configuration File
; Default settings by BAILOPAN

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the Main plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[settings]

;Sets whether CSDM is enabled or not.
enabled = 1

;Sets whether or not players should be stripped of weapons on round start
; (excludes knife)
strip_weapons = 1

;Sets how long weapons should stay on the ground for after being dropped
;in seconds.  note that enabling this can create lots of lag for clients 
; AND server.  0 is immediate, -1 is infinite.
weapons_stay = 0

;Sets the spawn mode.
; "none" - users spawn at normal map spawn points
; "preset" - csdm_spawn_preset.amxx required, uses predefined spawns in config files
; -- others may be supplied by 3rd party plugins
spawnmode = preset

;Sets whether the bomb is removed
remove_bomb = 1

;Sets the spawn waiting time
spawn_wait_time = 0.75

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the FFA plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ffa]
;Set whether free for all mode is enabled by default
enabled = 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the Misc plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[misc]
;Map objectives are removed by their flags.
; a - as_ maps
; b - buyzones are removed
; c - cs_ maps
; d - de_ maps
remove_objectives = abcd

;Blocks people from using all buy commands
block_buy = 1

;Auto-refills ammo when it gets depleted
ammo_refill = 1

;Says a radio command to a player when they respawn
spawn_radio_msg = 0


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the ticketing plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ticketing]

;Is round ticketing enabled?
enabled = 0

;Number of times a team can have players respawn before they stop
; being able to respawn
tickets = 150


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the protection plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[protection]

;Is spawn protection enabled?
enabled = 1

;Colors of glow shell, leave this in quotes
;The digits are R, G, B, A where A is the alpha transparency
; (as A gets higher, the glow shell is thicker)
colors = "0 255 0 200"

;Number of seconds someone is respawned for.
time = 2


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the equip plugin for these sections
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[equip]

;Equip Menu flags: 
; p - primary
; s - secondary
; a - armor
; g - grenade
; b - buy
menus = psa

;Autoitem flags:
; a - armor
; h - helmet
; g - grenades
; d - defusekit (CTs only!)
; n - nightvision
autoitems = ah

;Grenade flags:
; f - flashbang
; h - he grenade
; s - smoke grenade
grenades = h

;Sets number of flashbangs given if
; grenades are enabled
fnadesnum = 1


;;;;;;;;;;;;;;;;
;;WEAPON MENUS;;
;;;;;;;;;;;;;;;;

;Format for weapon menus is:
;shortname "Display Name" menupage
;Change the '1' to a '0' to block the weapon
;Removing or moving things 
;  from the list will change the order of the menus!

[secondary]
usp \w[\yUSP\w] 1
glock18 \w[\yGlock\w] 1
deagle \w[\rDeagle\w] 1
p228 \w[\yP228\w] 1
elite \w[\yElite\w] 1
fiveseven "\w[\yFive Seven\w]" 1

[primary]
m4a1 \w[\yM4A1\w] 1
ak47 \w[\yAK47\w] 1
aug \w[\yAUG\w] 1
sg552 \w[\ySG552\w] 1
galil \w[\yGalil\w] 1
famas \w[\yFamas\w] 1
scout \w[\yScout\w] 1
awp \w[\yAWP\w] 1
sg550 \w[\ySG550\w] 1
m249 \w[\yM249\w] 1
g3sg1 \w[\yG3SG1\w] 1
ump45 "\w[\yUMP 45\w]" 1
mp5navy "\w[\yMP5 Navy\w]" 1
m3 \w[\yM3\w] 1
xm1014 \w[\yXM1014\w] 1
tmp \w[\yTMP\w] 1
mac10 "\w[\yMac 10\w]" 1
p90 \w[\yP90\w] 1

;List weapons here the bots can randomly have
;The short name must match one in the list above
[botsecondary]
deagle
usp

[botprimary]
ak47
m4a1
awp
galil
aug

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;You must be running the item mode plugin for this section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[items]

;Is item mode enabled?
enabled = 0

;If set to 1, players will drop a pack of goodies when they die.
drop_packs = 1

;Sets the number of armor given by a battery. Default is 15.
battery = 15

;Sets the number of health given by a medkit. Default is 15.
medkit = 15

;Sets the time to wait for an item to reappear on its place. Default is 20 (0 = permanent)
item_time = 20

;Sets how long packs stay on the ground. (Max is 30 seconds)
drop_time = 20

;Remove semicolons to restrict any of the following items
; or add the short weapon names of the weapons you want to restrict (m4a1, ak47, awp ...)
[item_restrictions]
;longjump
;medkit
;battery
;pistolammo
;rifleammo
;shotammo
;smgammo
;awpammo
;paraammo
;fullammo
;armor

[/code]
csdm_equip.sma | Afiseaza codul
[code]/**
 * csdm_equip.sma
 * Allows for Counter-Strike to be played as DeathMatch.
 *
 * CSDM Equipment Menu
 *
 * By Freecode and BAILOPAN
 * (C)2003-2006 David "BAILOPAN" Anderson
 *
 *  Give credit where due.
 *  Share the source - it sets you free
 *  http://www.opensource.org/
 *  http://www.gnu.org/
 */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csdm>
#include <fakemeta>

//Tampering with the author and name lines can violate the copyright
new PLUGINNAME[] = "CSDM Equip"
new VERSION[] = CSDM_VERSION
new AUTHORS[] = "CSDM Team"

#define	EQUIP_PRI	(1<<0)
#define	EQUIP_SEC	(1<<1)
#define	EQUIP_ARMOR	(1<<2)
#define	EQUIP_GREN	(1<<3)
#define EQUIP_ITEMS	(1<<4)
#define	EQUIP_ALL	(EQUIP_PRI|EQUIP_SEC|EQUIP_ARMOR|EQUIP_GREN|EQUIP_ITEMS)

//Menus
new g_SecMenu[] = "\w[\yRS\w] : \rPistols"		// Menu Name
new g_SecMenuID = -1							// Menu ID
new g_cSecondary								// Menu Callback
new bool:g_mSecStatus = true					// Menu Available?

new g_PrimMenu[] = "\w[\yRS\w] : \rPrimary Weapons"
new g_PrimMenuID = -1
new g_cPrimary
new bool:g_mPrimStatus = true

new g_ArmorMenu[] = "\w[\yRS\w] : \rArmor"
new g_ArmorMenuID = -1
new bool:g_mArmorStatus = true

new g_NadeMenu[] = "\w[\yRS\w] : \rGranade"
new g_NadeMenuID = -1
new bool:g_mNadeStatus = true

new g_EquipMenu[] = "\w[\yRS\w] : \rWeapons Menu"
new g_EquipMenuID = -1

new bool:g_mShowuser[33] = true

new bool:g_mAutoNades = false
new bool:g_mAutoArmor = false

//Weapon Selections
new g_SecWeapons[33][18]
new g_PrimWeapons[33][18]
new bool:g_mNades[33]
new bool:g_mArmor[33]

//Config weapon storage holders
new g_BotPrim[MAX_WEAPONS][18]
new g_iNumBotPrim

new g_BotSec[MAX_WEAPONS][18]
new g_iNumBotSec

new g_Secondary[MAX_SECONDARY][18]
new bool:g_DisabledSec[MAX_WEAPONS]
new g_iNumSec

new g_Primary[MAX_PRIMARY][18]
new bool:g_DisabledPrim[MAX_WEAPONS]
new g_iNumPrim

#define SILENCED_M4A1	0
#define SILENCED_USP		1
new bool:g_Silenced[33][2]

//Misc
new g_Armor = 0
new fnadesnum = 0
new bool:g_Flash = false
new bool:g_Nade = false
new bool:g_Smoke = false
new bool:g_NightVision = false
new bool:g_DefuseKit = false

//Quick Fix for menu pages
new g_MenuState[33] = {0}

public csdm_Init(const version[])
{
	if (version[0] == 0)
	{
		set_fail_state("CSDM failed to load.")
		return
	}
	
	// Menus and callbacks
	g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
	g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
	g_ArmorMenuID = menu_create(g_ArmorMenu, "m_ArmorHandler", 0)
	g_NadeMenuID = menu_create(g_NadeMenu, "m_NadeHandler", 0)
	g_EquipMenuID = menu_create(g_EquipMenu, "m_EquipHandler", 0)
	
	menu_setprop(g_PrimMenuID, MPROP_EXIT, MEXIT_NEVER)
	menu_setprop(g_SecMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	g_cSecondary = menu_makecallback("c_Secondary")
	g_cPrimary = menu_makecallback("c_Primary")
}

public csdm_CfgInit()
{
	// Config reader
	csdm_reg_cfg("equip", "cfgSetting")
	// In order for weapon menu
	csdm_reg_cfg("secondary", "cfgSecondary")
	csdm_reg_cfg("primary", "cfgPrimary")
	csdm_reg_cfg("botprimary", "cfgBotPrim")
	csdm_reg_cfg("botsecondary", "cfgBotSec")
}

public plugin_init()
{
	register_plugin(PLUGINNAME, VERSION, AUTHORS)
	
	// Build Armor/Nade/Equip Menu's
	buildMenu()
	
	register_clcmd("say guns", "enableMenu")
	register_clcmd("say /guns", "enableMenu")
	register_clcmd("say menu", "enableMenu")
	register_clcmd("say enablemenu", "enableMenu")
	register_clcmd("say enable_menu", "enableMenu")
}

public client_connect(id)
{
	g_mShowuser[id] = true
	g_mNades[id] = false
	g_mArmor[id] = false
	g_Silenced[id][SILENCED_M4A1] = false
	g_Silenced[id][SILENCED_USP] = false
	
	return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
	g_mShowuser[id] = true
	g_mNades[id] = false
	g_mArmor[id] = false
	
	return PLUGIN_CONTINUE
}

public csdm_RemoveWeapon(owner, entity_id, boxed_id)
{
	new classname[32], weapon
	if (!pev_valid(entity_id))
	{
		return PLUGIN_CONTINUE
	}
	pev(entity_id, pev_classname, classname, 31)
	weapon = get_weaponid(classname)
	if (weapon == CSW_M4A1)
	{
		g_Silenced[owner][SILENCED_M4A1] = cs_get_weapon_silen(entity_id) ? true : false
	} else if (weapon == CSW_USP) {
		g_Silenced[owner][SILENCED_USP] = cs_get_weapon_silen(entity_id) ? true : false
	}
	
	return PLUGIN_CONTINUE
}

public csdm_PostDeath(killer, victim, headshot, const weapon[])
{
	/* Clean up any defusal kits we might have made! */
	if (!g_DefuseKit)
	{
		return
	}
	
	/* This might have a race condition for team switches... */
	if (cs_get_user_team(victim) == CS_TEAM_CT)
	{
		cs_set_user_defuse(victim, 0)
	}
}

public cfgSecondary(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
		if (g_iNumSec >= MAX_SECONDARY)
			return PLUGIN_HANDLED
		
		new wep[16], display[48], dis[4]
		new cmd[6]

		parse(line, wep, 15, display, 47, dis, 3)
		
		new disabled = str_to_num(dis)
		
		//Copy weapon into array
		format(g_Secondary[g_iNumSec], 17, "weapon_%s", wep)

		g_DisabledSec[g_iNumSec] = disabled ? false : true
		
		format(cmd,5,"%d ",g_iNumSec)
		g_iNumSec++
		
		//TODO: Add menu_destroy_items to remake menu on cfg reload
		menu_additem(g_SecMenuID, display, cmd, 0, g_cSecondary)
	}
	else if (readAction == CFG_RELOAD)
	{
		g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
		g_iNumSec = 0
	}
	else if (readAction == CFG_DONE)
	{
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgPrimary(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
		if (g_iNumPrim >= MAX_PRIMARY)	
			return PLUGIN_HANDLED
			
		new wep[16], display[48], dis[4]
		new cmd[6]

		parse(line, wep, 15, display, 47, dis, 3)
		
		new disabled = str_to_num(dis)
		
		//Copy weapon into array
		format(g_Primary[g_iNumPrim], 17, "weapon_%s", wep)
		g_DisabledPrim[g_iNumPrim] = disabled ? false : true
		
		format(cmd, 5, "%d", g_iNumPrim)
		g_iNumPrim++
		
		//TODO: Add menu_destroy_items to remake menu on cfg reload
		menu_additem(g_PrimMenuID, display, cmd, 0, g_cPrimary)
	} else if (readAction == CFG_RELOAD) {
		g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
		g_iNumPrim = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}
	
	
public cfgBotPrim(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
	
		new wep[16], display[32]

		parse(line, wep, 15, display, 31)
		
		//Copy weapon into array
		format(g_BotPrim[g_iNumBotPrim], 17, "weapon_%s", wep)
		g_iNumBotPrim++
	} else if (readAction == CFG_RELOAD) {
		g_iNumBotPrim = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgBotSec(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
	
		new wep[16], display[32]

		parse(line, wep, 15, display, 31)
		
		//Copy weapon into array
		format(g_BotSec[g_iNumBotSec], 17, "weapon_%s", wep)
		g_iNumBotSec++
	} else if (readAction == CFG_RELOAD) {
		g_iNumBotSec = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgSetting(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{

		new setting[16], sign[3], value[6]

		parse(line, setting, 15, sign, 2, value, 5)
		
		// Menus settings
		if (contain(setting,"menus") != -1)
		{
			if (containi(value, "p") != -1)
			{
				g_mPrimStatus = true
			}
			
			if (containi(value, "s") != -1)
			{
				g_mSecStatus = true
			}
			
			if (containi(value, "a") != -1)
			{
				g_mArmorStatus = true
			}
			
			if (containi(value, "g") != -1)
			{
				g_mNadeStatus = true
			}
			
			return PLUGIN_HANDLED
		} else if (contain(setting, "autoitems") != -1) {

			if (containi(value, "a")  != -1)
			{
				//Disable Armor Menu
				g_mArmorStatus = false
				g_mAutoArmor = true
				
				g_Armor = 1
			}
						
			if (containi(value, "h") != -1)
			{
				//Disable Armor Menu
				g_mArmorStatus = false
				g_mAutoArmor = true
				g_Armor = 2
			}
			
			if (containi(value, "g") != -1)
			{
				//Disable Grenade Menu
				g_mNadeStatus = false
				g_mAutoNades = true
			}
			
			if (containi(value, "d") != -1)
			{
				g_DefuseKit = true
			}
			
			if (containi(value, "n") != -1)
			{
				g_NightVision = true
			}
			
			return PLUGIN_HANDLED
		} else if (contain(setting, "grenades") != -1) {
			if (containi(value, "f") != -1)
			{
				g_Flash = true
			}
			
			if (containi(value, "h") != -1)
			{
				g_Nade = true
			}
			
			if (containi(value, "s") != -1)
			{
				g_Smoke = true
			}
		} else if (contain(setting, "fnadesnum") != -1) {
			fnadesnum = str_to_num(value)
		}
		
		return PLUGIN_HANDLED
	} else if (readAction == CFG_RELOAD) {
		g_mArmorStatus = false
		g_mNadeStatus = false
		g_Flash = false
		g_Nade = false
		g_Smoke = false
		g_Armor = 0
		g_mSecStatus = false
		g_mPrimStatus = false
		g_mAutoNades = false
		g_DefuseKit = false
		g_NightVision = false
		fnadesnum = 1
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

//Secondary Weapon Callback
public c_Secondary(id, menu, item)
{

	if( item < 0 ) return PLUGIN_CONTINUE
	
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new dis = str_to_num(cmd)
	
	//Check to see if item is disabled
	if (g_DisabledSec[dis])
	{
		return ITEM_DISABLED
	}
	else
	{
		return ITEM_ENABLED
	}
	
	return PLUGIN_HANDLED
}

//Primary Weapon Callback
public c_Primary(id, menu, item)
{

	if (item < 0)
		return PLUGIN_CONTINUE
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new dis = str_to_num(cmd)
	
	//Check to see if item is disabled
	if (g_DisabledPrim[dis])
	{
		return ITEM_DISABLED
	}
	else
	{
		return ITEM_ENABLED
	}
	
	return PLUGIN_HANDLED
}

//Equipment Menu handler
public m_EquipHandler(id, menu, item)
{
	if (item < 0)
	{
		return PLUGIN_CONTINUE
	}
	
	// Get item info
	new cmd[2], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd, 1, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	switch(choice)
	{
		case 1:
		{
			if (g_mSecStatus)
			{
				menu_display(id, g_SecMenuID, 0)
			}
			else if (g_mPrimStatus)
			{
				menu_display(id, g_PrimMenuID, 0)
			}
			else if (g_mArmorStatus)
			{
				menu_display(id, g_ArmorMenuID, 0)
			}
			else if (g_mNadeStatus)
			{
				if (g_mAutoArmor)
				{
					equipUser(id, EQUIP_ARMOR)
				}
				menu_display(id, g_NadeMenuID, 0)
			} else {
				if (g_mAutoArmor)
				{
					equipUser(id, EQUIP_ARMOR)
				}
				if (g_mAutoNades)
				{
					equipUser(id, EQUIP_GREN)
				}
				equipUser(id, EQUIP_ITEMS)
			}
		}
		case 2:
		{
			// Equip person with last settings
			equipUser(id, EQUIP_ALL)
		}
		case 3:
		{
			g_mShowuser[id] = false
			client_print(id, print_chat, "[CSDM] Type ^"guns^" in chat to re-enable your equip menu.")
			equipUser(id, EQUIP_ALL)
		}
	}
	
	return PLUGIN_HANDLED
}

//Secondary Wep Menu handler
public m_SecHandler(id, menu, item)
{
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new wep = str_to_num(cmd)
	
	copy(g_SecWeapons[id],17,g_Secondary[wep])
	equipUser(id, EQUIP_SEC)
	
	// Show next menu here
	
	if (g_mPrimStatus)
	{
		menu_display(id, g_PrimMenuID, 0)
	}
	else if (g_mArmorStatus)
	{
		menu_display(id, g_ArmorMenuID, 0)
	}
	else if (g_mNadeStatus)
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		menu_display(id, g_NadeMenuID, 0)
	}
	else
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Primary Wep Menu handler
public m_PrimHandler(id, menu, item)
{
	if (item < 0)  return PLUGIN_HANDLED
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	if (menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback))
	{
		new wep = str_to_num(cmd)
	
		copy(g_PrimWeapons[id], 17, g_Primary[wep])
		equipUser(id, EQUIP_PRI)
	}
		
	// Show next menu here
		
	if (g_mArmorStatus)
	{
		menu_display(id, g_ArmorMenuID, 0)
	}
	else if (g_mNadeStatus)
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		menu_display(id, g_NadeMenuID, 0)
	} else {
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Armor Menu handler
public m_ArmorHandler(id, menu, item)
{
	if (item < 0) return PLUGIN_CONTINUE
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback

	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	if (choice == 1)
	{
		g_mArmor[id] = true
	}
	else if (choice == 2)
	{
		g_mArmor[id] = false
	}
	equipUser(id, EQUIP_ARMOR)
	
	// Show next menu here
	
	if (g_mNadeStatus)
	{
		menu_display(id, g_NadeMenuID, 0)
	} else {
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Nade Menu handler
public m_NadeHandler(id, menu, item)
{
	if (item < 0) return PLUGIN_CONTINUE
	
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd, 5, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	if (choice == 1)
	{
		g_mNades[id] = true
	}
	else if (choice == 2)
	{
		g_mNades[id] = false
	}
	
	equipUser(id, EQUIP_GREN)
	equipUser(id, EQUIP_ITEMS)

	return PLUGIN_HANDLED
}

buildMenu()
{
	//Equip Menu
	menu_additem(g_EquipMenuID, "\w( \yNew Guns \w)", "1", 0, -1)
	menu_additem(g_EquipMenuID, "\w( \yPrevious Setup \w)", "2", 0, -1)
	menu_additem(g_EquipMenuID, "\w( \yDon't show menu again \w)", "3", 0, -1)
	menu_setprop(g_EquipMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	//Armor Menu
	menu_additem(g_ArmorMenuID, "\w( \yYes, armor up \w)", "1", 0, -1)
	menu_additem(g_ArmorMenuID, "\w( \yNo Armor \w)", "2", 0, -1)
	menu_setprop(g_ArmorMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	//Nade Menu
	menu_additem(g_NadeMenuID, "\w( \yAll Grenades \w)", "1", 0, -1)
	menu_additem(g_NadeMenuID, "\w( \yNo Grenades \w)", "2", 0, -1)
	menu_setprop(g_NadeMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	return PLUGIN_HANDLED
}

equipUser(id, to)
{
	if (!is_user_alive(id) )
		return
	
	if (to & EQUIP_SEC)
	{
		//Give Secondary
		GiveUserFullWeapon(id, g_SecWeapons[id])
	}
	
	if (to & EQUIP_PRI)
	{
		//Give Primary
		GiveUserFullWeapon(id, g_PrimWeapons[id])
	}
	
	if (to & EQUIP_ARMOR)
	{
		//Give Armor
		if (g_mAutoArmor || g_mArmor[id])
		{
			new armor = g_mArmor[id] ? 2 : g_Armor
			cs_set_user_armor(id, DEFAULT_ARMOR, CsArmorType:armor)
		}
	}
	
	if (to & EQUIP_GREN)
	{
		//Give Nades
		if (g_mNades[id] || g_mAutoNades)
		{
				
			if (g_Nade)
			{
				GiveUserFullWeapon(id,"weapon_hegrenade")
			}
			
			if (g_Smoke)
			{
				GiveUserFullWeapon(id, "weapon_smokegrenade")
			}
		
			if (g_Flash && fnadesnum)
			{
				GiveUserFullWeapon(id, "weapon_flashbang")
				if (fnadesnum == 2)
				{
					GiveUserFullWeapon(id, "weapon_flashbang")
				}
			}

		}
	}
	
	if (to & EQUIP_ITEMS)
	{
		if (g_DefuseKit && (cs_get_user_team(id) == CS_TEAM_CT))
		{
			cs_set_user_defuse(id, 1)
		}
		if (g_NightVision)
		{
			cs_set_user_nvg(id, 1)
		}
	}
}

GiveUserFullWeapon(id, const wp[])
{
	/** First check to make sure the user does not have a weapon in this slot */
	new wpnid = get_weaponid(wp)
	new weapons[MAX_WEAPONS], num
	new name[24], weap
	new slot
	if (wpnid == 0)
	{
		if (equal(wp, "weapon_shield"))
		{
			slot = SLOT_PRIMARY
			wpnid = -1
		}
	} else {
		slot = g_WeaponSlots[wpnid]
	}
	if ((slot == SLOT_SECONDARY || slot == SLOT_PRIMARY)
		 && wpnid > 0)
	{
		get_user_weapons(id, weapons, num)
		for (new i=0; i<num; i++)
		{
			weap = weapons
			if (weap == wpnid)
			{
				continue
			}
			if (g_WeaponSlots[weap] == slot)
			{
				if (slot == SLOT_SECONDARY && cs_get_user_shield(id))
				{
					//temporary fix!
					drop_with_shield(id, weap)
				} else {
					get_weaponname(weap, name, 23)
					csdm_force_drop(id, name)
				}
			}
		}
	} else if (slot == SLOT_PRIMARY && wpnid == -1 && cs_get_user_shield(id)) {
		return
	}
	
	if (slot == SLOT_PRIMARY && cs_get_user_shield(id) && wpnid > 0)
	{
		csdm_fwd_drop(id, -1, "weapon_shield")
	}
	
	new item_id = csdm_give_item(id, wp)
	if (item_id > 0)
	{
		if (wpnid == CSW_M4A1)
		{
			cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_M4A1], 1)
		} else if (wpnid == CSW_USP) {
			cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_USP], 1)
		}
	}

	if (wpnid > 0)
	{
		new bpammo = g_MaxBPAmmo[wpnid]
		if (bpammo)
		{
			cs_set_user_bpammo(id, wpnid, bpammo)
		}
	}
}

// MAIN FUNCTION OF THE PLUGIN
public csdm_PostSpawn(player)
{
	if (is_user_bot(player))
	{
			new randPrim = random_num(0, g_iNumBotPrim-1)
			new randSec = random_num(0, g_iNumBotSec-1)
	        
			// By our lMOSTeast favorite guy KWo RIP - 02.11.2005.
			new randArm = random_num(0, 2)
			new randGre = random_num(0, 2)
			
			GiveUserFullWeapon(player, g_BotPrim[randPrim])
			GiveUserFullWeapon(player, g_BotSec[randSec])

			g_mArmor[player] = (g_mArmorStatus && randArm)
			g_mNades[player] = (g_mNadeStatus && randGre)
	
			if (g_mAutoArmor || g_mArmor[player])
			{
				equipUser(player, EQUIP_ARMOR)
			}

			if (g_mAutoNades || g_mNades[player])
			{
				equipUser(player, EQUIP_GREN)
			}
			if (g_DefuseKit)
			{
				equipUser(player, EQUIP_ITEMS)
			}
	} else {
		if (g_mShowuser[player])
		{
			g_MenuState[player] = 1
			menu_display(player, g_EquipMenuID, 0)
		} else {
			g_MenuState[player] = 0
			equipUser(player, EQUIP_ALL)
		}
	}
	
	return PLUGIN_CONTINUE
}

public enableMenu(id)
{
	if (!csdm_active())
		return PLUGIN_CONTINUE
		
	if (!g_mShowuser[id])
	{
		g_mShowuser[id] = true
		client_print(id, print_chat, "[CSDM] Your equip menu has been re-enabled.")
		if (!g_MenuState[id])
		{
			g_MenuState[id] = 1
			menu_display(id, g_EquipMenuID, 0)
		}
	} else {
		client_print(id, print_chat, "[CSDM] Your equip menu is already enabled.")
	}
	
	return PLUGIN_HANDLED
}
[/code]
no...
User avatar
(c) WaRninG.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 261
Joined: 13 Jul 2018, 14:44
Detinator Steam: Da
Detinator server CS: 《ZP.PLAYARENA.RO 》
SteamID: Andu
Reputatie: Utilizator neserios (tepar!)
Membru Club eXtreamCS (4 Ian - 4 Mai)
Nick anterior: Andrei # QualTech
-1 avertisment (2 luni club)
Fond eXtream: 0
Location: Câmpulung
Has thanked: 3 times
Contact:

04 Dec 2018, 23:40

Scuze ca revin tocmai acum cu un raspuns, dar nu functioneaza sa-l compliez. ( http://prntscr.com/lqrlci )
User avatar
DevilBoy.eXe
Super moderator
Super moderator
Posts: 1677
Joined: 05 Jun 2016, 23:04
Detinator Steam: Da
Detinator server CS: GO.WARED.RO
SteamID: DevilBoy_eXe
Reputatie: Super Moderator
Fond eXtream: 0
Location: beyond the time
Discord: zeux.
Has thanked: 15 times
Been thanked: 71 times
Contact:

04 Dec 2018, 23:54

OnLyYoNuTz wrote:numai cu cersitu umblati, poate fodatoru a scos niste bani din buzunar pentru acel plugin si tu il vrei pe degeaba.
Ce plugin ma?! Niste culori bagate la misto in config pff...

Vezi si tu eroarea ce zice, daca nu stii engleza https://translate.google.ro/?hl=ro#view ... l=en&tl=ro si ca sa te scutesc de munca, acel plugin trebuie compilat local si incluzand csdm.inc

OFF: De ce vrei tu sa ai ce are si el si nu altfel? Sa fii unic nu copia cuiva, stiu acel server, are playeri doar din boost e praf fara boost, nu e nimic special la el ;)
User avatar
kiarfuzzy
Membru, skill +1
Membru, skill +1
Posts: 375
Joined: 06 Jan 2008, 15:20
Detinator Steam: Da
Detinator server CS: Fy.Play-Arena.Ro
SteamID: FuZzy1
Reputatie: Fost Membru Club eXtreamCS (trei luni)
Been thanked: 3 times

05 Dec 2018, 10:45

Sunt bune modificarile Laurentiu P., l-am pus si eu pe server la mine...
User avatar
VD*
Membru, skill 0
Membru, skill 0
Posts: 4
Joined: 31 May 2017, 17:18
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: https://steamcommuni
Fond eXtream: 0
Location: Focşani
Contact:

14 May 2020, 15:59

//// csdm_equip.sma
// C:\Users\sorin\OneDrive\Desktop\amestecate\complier\csdm_equip.sma(805 -- 806) : error 006: must be assigned to an array
//
// 1 Error.
// Could not locate output file compiled\csdm_equip.amx (compile failed).
//
// Compilation Time: 0.33 sec

cum rezolv si eu asta?
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

15 May 2020, 11:24

Code: Select all

/**
 * csdm_equip.sma
 * Allows for Counter-Strike to be played as DeathMatch.
 *
 * CSDM Equipment Menu
 *
 * By Freecode and BAILOPAN
 * (C)2003-2006 David "BAILOPAN" Anderson
 *
 *  Give credit where due.
 *  Share the source - it sets you free
 *  http://www.opensource.org/
 *  http://www.gnu.org/
 */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csdm>
#include <fakemeta>

//Tampering with the author and name lines can violate the copyright
new PLUGINNAME[] = "CSDM Equip"
new VERSION[] = CSDM_VERSION
new AUTHORS[] = "CSDM Team"

#define	EQUIP_PRI	(1<<0)
#define	EQUIP_SEC	(1<<1)
#define	EQUIP_ARMOR	(1<<2)
#define	EQUIP_GREN	(1<<3)
#define EQUIP_ITEMS	(1<<4)
#define	EQUIP_ALL	(EQUIP_PRI|EQUIP_SEC|EQUIP_ARMOR|EQUIP_GREN|EQUIP_ITEMS)

//Menus
new g_SecMenu[] = "\w[\yRS\w] : \rPistols"		// Menu Name
new g_SecMenuID = -1							// Menu ID
new g_cSecondary								// Menu Callback
new bool:g_mSecStatus = true					// Menu Available?

new g_PrimMenu[] = "\w[\yRS\w] : \rPrimary Weapons"
new g_PrimMenuID = -1
new g_cPrimary
new bool:g_mPrimStatus = true

new g_ArmorMenu[] = "\w[\yRS\w] : \rArmor"
new g_ArmorMenuID = -1
new bool:g_mArmorStatus = true

new g_NadeMenu[] = "\w[\yRS\w] : \rGranade"
new g_NadeMenuID = -1
new bool:g_mNadeStatus = true

new g_EquipMenu[] = "\w[\yRS\w] : \rWeapons Menu"
new g_EquipMenuID = -1

new bool:g_mShowuser[33] = true

new bool:g_mAutoNades = false
new bool:g_mAutoArmor = false

//Weapon Selections
new g_SecWeapons[33][18]
new g_PrimWeapons[33][18]
new bool:g_mNades[33]
new bool:g_mArmor[33]

//Config weapon storage holders
new g_BotPrim[MAX_WEAPONS][18]
new g_iNumBotPrim

new g_BotSec[MAX_WEAPONS][18]
new g_iNumBotSec

new g_Secondary[MAX_SECONDARY][18]
new bool:g_DisabledSec[MAX_WEAPONS]
new g_iNumSec

new g_Primary[MAX_PRIMARY][18]
new bool:g_DisabledPrim[MAX_WEAPONS]
new g_iNumPrim

#define SILENCED_M4A1	0
#define SILENCED_USP		1
new bool:g_Silenced[33][2]

//Misc
new g_Armor = 0
new fnadesnum = 0
new bool:g_Flash = false
new bool:g_Nade = false
new bool:g_Smoke = false
new bool:g_NightVision = false
new bool:g_DefuseKit = false

//Quick Fix for menu pages
new g_MenuState[33] = {0}

public csdm_Init(const version[])
{
	if (version[0] == 0)
	{
		set_fail_state("CSDM failed to load.")
		return
	}
	
	// Menus and callbacks
	g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
	g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
	g_ArmorMenuID = menu_create(g_ArmorMenu, "m_ArmorHandler", 0)
	g_NadeMenuID = menu_create(g_NadeMenu, "m_NadeHandler", 0)
	g_EquipMenuID = menu_create(g_EquipMenu, "m_EquipHandler", 0)
	
	menu_setprop(g_PrimMenuID, MPROP_EXIT, MEXIT_NEVER)
	menu_setprop(g_SecMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	g_cSecondary = menu_makecallback("c_Secondary")
	g_cPrimary = menu_makecallback("c_Primary")
}

public csdm_CfgInit()
{
	// Config reader
	csdm_reg_cfg("equip", "cfgSetting")
	// In order for weapon menu
	csdm_reg_cfg("secondary", "cfgSecondary")
	csdm_reg_cfg("primary", "cfgPrimary")
	csdm_reg_cfg("botprimary", "cfgBotPrim")
	csdm_reg_cfg("botsecondary", "cfgBotSec")
}

public plugin_init()
{
	register_plugin(PLUGINNAME, VERSION, AUTHORS)
	
	// Build Armor/Nade/Equip Menu's
	buildMenu()
	
	register_clcmd("say guns", "enableMenu")
	register_clcmd("say /guns", "enableMenu")
	register_clcmd("say menu", "enableMenu")
	register_clcmd("say enablemenu", "enableMenu")
	register_clcmd("say enable_menu", "enableMenu")
}

public client_connect(id)
{
	g_mShowuser[id] = true
	g_mNades[id] = false
	g_mArmor[id] = false
	g_Silenced[id][SILENCED_M4A1] = false
	g_Silenced[id][SILENCED_USP] = false
	
	return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
	g_mShowuser[id] = true
	g_mNades[id] = false
	g_mArmor[id] = false
	
	return PLUGIN_CONTINUE
}

public csdm_RemoveWeapon(owner, entity_id, boxed_id)
{
	new classname[32], weapon
	if (!pev_valid(entity_id))
	{
		return PLUGIN_CONTINUE
	}
	pev(entity_id, pev_classname, classname, 31)
	weapon = get_weaponid(classname)
	if (weapon == CSW_M4A1)
	{
		g_Silenced[owner][SILENCED_M4A1] = cs_get_weapon_silen(entity_id) ? true : false
	} else if (weapon == CSW_USP) {
		g_Silenced[owner][SILENCED_USP] = cs_get_weapon_silen(entity_id) ? true : false
	}
	
	return PLUGIN_CONTINUE
}

public csdm_PostDeath(killer, victim, headshot, const weapon[])
{
	/* Clean up any defusal kits we might have made! */
	if (!g_DefuseKit)
	{
		return
	}
	
	/* This might have a race condition for team switches... */
	if (cs_get_user_team(victim) == CS_TEAM_CT)
	{
		cs_set_user_defuse(victim, 0)
	}
}

public cfgSecondary(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
		if (g_iNumSec >= MAX_SECONDARY)
			return PLUGIN_HANDLED
		
		new wep[16], display[48], dis[4]
		new cmd[6]

		parse(line, wep, 15, display, 47, dis, 3)
		
		new disabled = str_to_num(dis)
		
		//Copy weapon into array
		format(g_Secondary[g_iNumSec], 17, "weapon_%s", wep)

		g_DisabledSec[g_iNumSec] = disabled ? false : true
		
		format(cmd,5,"%d ",g_iNumSec)
		g_iNumSec++
		
		//TODO: Add menu_destroy_items to remake menu on cfg reload
		menu_additem(g_SecMenuID, display, cmd, 0, g_cSecondary)
	}
	else if (readAction == CFG_RELOAD)
	{
		g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
		g_iNumSec = 0
	}
	else if (readAction == CFG_DONE)
	{
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgPrimary(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
		if (g_iNumPrim >= MAX_PRIMARY)	
			return PLUGIN_HANDLED
			
		new wep[16], display[48], dis[4]
		new cmd[6]

		parse(line, wep, 15, display, 47, dis, 3)
		
		new disabled = str_to_num(dis)
		
		//Copy weapon into array
		format(g_Primary[g_iNumPrim], 17, "weapon_%s", wep)
		g_DisabledPrim[g_iNumPrim] = disabled ? false : true
		
		format(cmd, 5, "%d", g_iNumPrim)
		g_iNumPrim++
		
		//TODO: Add menu_destroy_items to remake menu on cfg reload
		menu_additem(g_PrimMenuID, display, cmd, 0, g_cPrimary)
	} else if (readAction == CFG_RELOAD) {
		g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
		g_iNumPrim = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}
	
	
public cfgBotPrim(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
	
		new wep[16], display[32]

		parse(line, wep, 15, display, 31)
		
		//Copy weapon into array
		format(g_BotPrim[g_iNumBotPrim], 17, "weapon_%s", wep)
		g_iNumBotPrim++
	} else if (readAction == CFG_RELOAD) {
		g_iNumBotPrim = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgBotSec(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{
	
		new wep[16], display[32]

		parse(line, wep, 15, display, 31)
		
		//Copy weapon into array
		format(g_BotSec[g_iNumBotSec], 17, "weapon_%s", wep)
		g_iNumBotSec++
	} else if (readAction == CFG_RELOAD) {
		g_iNumBotSec = 0
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public cfgSetting(readAction, line[], section[])
{
	if (readAction == CFG_READ)
	{

		new setting[16], sign[3], value[6]

		parse(line, setting, 15, sign, 2, value, 5)
		
		// Menus settings
		if (contain(setting,"menus") != -1)
		{
			if (containi(value, "p") != -1)
			{
				g_mPrimStatus = true
			}
			
			if (containi(value, "s") != -1)
			{
				g_mSecStatus = true
			}
			
			if (containi(value, "a") != -1)
			{
				g_mArmorStatus = true
			}
			
			if (containi(value, "g") != -1)
			{
				g_mNadeStatus = true
			}
			
			return PLUGIN_HANDLED
		} else if (contain(setting, "autoitems") != -1) {

			if (containi(value, "a")  != -1)
			{
				//Disable Armor Menu
				g_mArmorStatus = false
				g_mAutoArmor = true
				
				g_Armor = 1
			}
						
			if (containi(value, "h") != -1)
			{
				//Disable Armor Menu
				g_mArmorStatus = false
				g_mAutoArmor = true
				g_Armor = 2
			}
			
			if (containi(value, "g") != -1)
			{
				//Disable Grenade Menu
				g_mNadeStatus = false
				g_mAutoNades = true
			}
			
			if (containi(value, "d") != -1)
			{
				g_DefuseKit = true
			}
			
			if (containi(value, "n") != -1)
			{
				g_NightVision = true
			}
			
			return PLUGIN_HANDLED
		} else if (contain(setting, "grenades") != -1) {
			if (containi(value, "f") != -1)
			{
				g_Flash = true
			}
			
			if (containi(value, "h") != -1)
			{
				g_Nade = true
			}
			
			if (containi(value, "s") != -1)
			{
				g_Smoke = true
			}
		} else if (contain(setting, "fnadesnum") != -1) {
			fnadesnum = str_to_num(value)
		}
		
		return PLUGIN_HANDLED
	} else if (readAction == CFG_RELOAD) {
		g_mArmorStatus = false
		g_mNadeStatus = false
		g_Flash = false
		g_Nade = false
		g_Smoke = false
		g_Armor = 0
		g_mSecStatus = false
		g_mPrimStatus = false
		g_mAutoNades = false
		g_DefuseKit = false
		g_NightVision = false
		fnadesnum = 1
	} else if (readAction == CFG_DONE) {
		//Nothing for now
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

//Secondary Weapon Callback
public c_Secondary(id, menu, item)
{

	if( item < 0 ) return PLUGIN_CONTINUE
	
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new dis = str_to_num(cmd)
	
	//Check to see if item is disabled
	if (g_DisabledSec[dis])
	{
		return ITEM_DISABLED
	}
	else
	{
		return ITEM_ENABLED
	}
	
	return PLUGIN_HANDLED
}

//Primary Weapon Callback
public c_Primary(id, menu, item)
{

	if (item < 0)
		return PLUGIN_CONTINUE
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new dis = str_to_num(cmd)
	
	//Check to see if item is disabled
	if (g_DisabledPrim[dis])
	{
		return ITEM_DISABLED
	}
	else
	{
		return ITEM_ENABLED
	}
	
	return PLUGIN_HANDLED
}

//Equipment Menu handler
public m_EquipHandler(id, menu, item)
{
	if (item < 0)
	{
		return PLUGIN_CONTINUE
	}
	
	// Get item info
	new cmd[2], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd, 1, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	switch(choice)
	{
		case 1:
		{
			if (g_mSecStatus)
			{
				menu_display(id, g_SecMenuID, 0)
			}
			else if (g_mPrimStatus)
			{
				menu_display(id, g_PrimMenuID, 0)
			}
			else if (g_mArmorStatus)
			{
				menu_display(id, g_ArmorMenuID, 0)
			}
			else if (g_mNadeStatus)
			{
				if (g_mAutoArmor)
				{
					equipUser(id, EQUIP_ARMOR)
				}
				menu_display(id, g_NadeMenuID, 0)
			} else {
				if (g_mAutoArmor)
				{
					equipUser(id, EQUIP_ARMOR)
				}
				if (g_mAutoNades)
				{
					equipUser(id, EQUIP_GREN)
				}
				equipUser(id, EQUIP_ITEMS)
			}
		}
		case 2:
		{
			// Equip person with last settings
			equipUser(id, EQUIP_ALL)
		}
		case 3:
		{
			g_mShowuser[id] = false
			client_print(id, print_chat, "[CSDM] Type ^"guns^" in chat to re-enable your equip menu.")
			equipUser(id, EQUIP_ALL)
		}
	}
	
	return PLUGIN_HANDLED
}

//Secondary Wep Menu handler
public m_SecHandler(id, menu, item)
{
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new wep = str_to_num(cmd)
	
	copy(g_SecWeapons[id],17,g_Secondary[wep])
	equipUser(id, EQUIP_SEC)
	
	// Show next menu here
	
	if (g_mPrimStatus)
	{
		menu_display(id, g_PrimMenuID, 0)
	}
	else if (g_mArmorStatus)
	{
		menu_display(id, g_ArmorMenuID, 0)
	}
	else if (g_mNadeStatus)
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		menu_display(id, g_NadeMenuID, 0)
	}
	else
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Primary Wep Menu handler
public m_PrimHandler(id, menu, item)
{
	if (item < 0)  return PLUGIN_HANDLED
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback
	
	if (menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback))
	{
		new wep = str_to_num(cmd)
	
		copy(g_PrimWeapons[id], 17, g_Primary[wep])
		equipUser(id, EQUIP_PRI)
	}
		
	// Show next menu here
		
	if (g_mArmorStatus)
	{
		menu_display(id, g_ArmorMenuID, 0)
	}
	else if (g_mNadeStatus)
	{
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		menu_display(id, g_NadeMenuID, 0)
	} else {
		if (g_mAutoArmor)
		{
			equipUser(id, EQUIP_ARMOR)
		}
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Armor Menu handler
public m_ArmorHandler(id, menu, item)
{
	if (item < 0) return PLUGIN_CONTINUE
	
	// Get item info
	new cmd[6], iName[64]
	new access, callback

	menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	if (choice == 1)
	{
		g_mArmor[id] = true
	}
	else if (choice == 2)
	{
		g_mArmor[id] = false
	}
	equipUser(id, EQUIP_ARMOR)
	
	// Show next menu here
	
	if (g_mNadeStatus)
	{
		menu_display(id, g_NadeMenuID, 0)
	} else {
		if (g_mAutoNades)
		{
			equipUser(id, EQUIP_GREN)
		}
		equipUser(id, EQUIP_ITEMS)
	}
	
	return PLUGIN_HANDLED
}

//Nade Menu handler
public m_NadeHandler(id, menu, item)
{
	if (item < 0) return PLUGIN_CONTINUE
	
	new cmd[6], iName[64]
	new access, callback
	
	menu_item_getinfo(menu, item, access, cmd, 5, iName, 63, callback)
	
	new choice = str_to_num(cmd)
	
	if (choice == 1)
	{
		g_mNades[id] = true
	}
	else if (choice == 2)
	{
		g_mNades[id] = false
	}
	
	equipUser(id, EQUIP_GREN)
	equipUser(id, EQUIP_ITEMS)

	return PLUGIN_HANDLED
}

buildMenu()
{
	//Equip Menu
	menu_additem(g_EquipMenuID, "\w( \yNew Guns \w)", "1", 0, -1)
	menu_additem(g_EquipMenuID, "\w( \yPrevious Setup \w)", "2", 0, -1)
	menu_additem(g_EquipMenuID, "\w( \yDon't show menu again \w)", "3", 0, -1)
	menu_setprop(g_EquipMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	//Armor Menu
	menu_additem(g_ArmorMenuID, "\w( \yYes, armor up \w)", "1", 0, -1)
	menu_additem(g_ArmorMenuID, "\w( \yNo Armor \w)", "2", 0, -1)
	menu_setprop(g_ArmorMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	//Nade Menu
	menu_additem(g_NadeMenuID, "\w( \yAll Grenades \w)", "1", 0, -1)
	menu_additem(g_NadeMenuID, "\w( \yNo Grenades \w)", "2", 0, -1)
	menu_setprop(g_NadeMenuID, MPROP_EXIT, MEXIT_NEVER)
	
	return PLUGIN_HANDLED
}

equipUser(id, to)
{
	if (!is_user_alive(id) )
		return
	
	if (to & EQUIP_SEC)
	{
		//Give Secondary
		GiveUserFullWeapon(id, g_SecWeapons[id])
	}
	
	if (to & EQUIP_PRI)
	{
		//Give Primary
		GiveUserFullWeapon(id, g_PrimWeapons[id])
	}
	
	if (to & EQUIP_ARMOR)
	{
		//Give Armor
		if (g_mAutoArmor || g_mArmor[id])
		{
			new armor = g_mArmor[id] ? 2 : g_Armor
			cs_set_user_armor(id, DEFAULT_ARMOR, CsArmorType:armor)
		}
	}
	
	if (to & EQUIP_GREN)
	{
		//Give Nades
		if (g_mNades[id] || g_mAutoNades)
		{
				
			if (g_Nade)
			{
				GiveUserFullWeapon(id,"weapon_hegrenade")
			}
			
			if (g_Smoke)
			{
				GiveUserFullWeapon(id, "weapon_smokegrenade")
			}
		
			if (g_Flash && fnadesnum)
			{
				GiveUserFullWeapon(id, "weapon_flashbang")
				if (fnadesnum == 2)
				{
					GiveUserFullWeapon(id, "weapon_flashbang")
				}
			}

		}
	}
	
	if (to & EQUIP_ITEMS)
	{
		if (g_DefuseKit && (cs_get_user_team(id) == CS_TEAM_CT))
		{
			cs_set_user_defuse(id, 1)
		}
		if (g_NightVision)
		{
			cs_set_user_nvg(id, 1)
		}
	}
}

GiveUserFullWeapon(id, const wp[])
{
	/** First check to make sure the user does not have a weapon in this slot */
	new wpnid = get_weaponid(wp)
	new weapons[MAX_WEAPONS], num
	new name[24], weap
	new slot
	if (wpnid == 0)
	{
		if (equal(wp, "weapon_shield"))
		{
			slot = SLOT_PRIMARY
			wpnid = -1
		}
	} else {
		slot = g_WeaponSlots[wpnid]
	}
	if ((slot == SLOT_SECONDARY || slot == SLOT_PRIMARY)
		 && wpnid > 0)
	{
		get_user_weapons(id, weapons, num)
		for (new i=0; i<num; i++)
		{
			weap = weapons[i]
			if (weap == wpnid)
			{
				continue
			}
			if (g_WeaponSlots[weap] == slot)
			{
				if (slot == SLOT_SECONDARY && cs_get_user_shield(id))
				{
					//temporary fix!
					drop_with_shield(id, weap)
				} else {
					get_weaponname(weap, name, 23)
					csdm_force_drop(id, name)
				}
			}
		}
	} else if (slot == SLOT_PRIMARY && wpnid == -1 && cs_get_user_shield(id)) {
		return
	}
	
	if (slot == SLOT_PRIMARY && cs_get_user_shield(id) && wpnid > 0)
	{
		csdm_fwd_drop(id, -1, "weapon_shield")
	}
	
	new item_id = csdm_give_item(id, wp)
	if (item_id > 0)
	{
		if (wpnid == CSW_M4A1)
		{
			cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_M4A1], 1)
		} else if (wpnid == CSW_USP) {
			cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_USP], 1)
		}
	}

	if (wpnid > 0)
	{
		new bpammo = g_MaxBPAmmo[wpnid]
		if (bpammo)
		{
			cs_set_user_bpammo(id, wpnid, bpammo)
		}
	}
}

// MAIN FUNCTION OF THE PLUGIN
public csdm_PostSpawn(player)
{
	if (is_user_bot(player))
	{
			new randPrim = random_num(0, g_iNumBotPrim-1)
			new randSec = random_num(0, g_iNumBotSec-1)
	        
			// By our lMOSTeast favorite guy KWo RIP - 02.11.2005.
			new randArm = random_num(0, 2)
			new randGre = random_num(0, 2)
			
			GiveUserFullWeapon(player, g_BotPrim[randPrim])
			GiveUserFullWeapon(player, g_BotSec[randSec])

			g_mArmor[player] = (g_mArmorStatus && randArm)
			g_mNades[player] = (g_mNadeStatus && randGre)
	
			if (g_mAutoArmor || g_mArmor[player])
			{
				equipUser(player, EQUIP_ARMOR)
			}

			if (g_mAutoNades || g_mNades[player])
			{
				equipUser(player, EQUIP_GREN)
			}
			if (g_DefuseKit)
			{
				equipUser(player, EQUIP_ITEMS)
			}
	} else {
		if (g_mShowuser[player])
		{
			g_MenuState[player] = 1
			menu_display(player, g_EquipMenuID, 0)
		} else {
			g_MenuState[player] = 0
			equipUser(player, EQUIP_ALL)
		}
	}
	
	return PLUGIN_CONTINUE
}

public enableMenu(id)
{
	if (!csdm_active())
		return PLUGIN_CONTINUE
		
	if (!g_mShowuser[id])
	{
		g_mShowuser[id] = true
		client_print(id, print_chat, "[CSDM] Your equip menu has been re-enabled.")
		if (!g_MenuState[id])
		{
			g_MenuState[id] = 1
			menu_display(id, g_EquipMenuID, 0)
		}
	} else {
		client_print(id, print_chat, "[CSDM] Your equip menu is already enabled.")
	}
	
	return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
ai nevoie de csdm.inc

Code: Select all

/**
 * (C)2003-2006 David "BAILOPAN" Anderson
 * Counter-Strike Deathmatch (CSDM) 2.10 Module Includes
 */

#if defined _csdm_included
  #endinput
#endif
#define _csdm_included

#if AMXX_VERSION_NUM >= 175
 #pragma reqlib csdm
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib csdm
 #endif
#else
 #pragma library csdm
#endif

#define	CSDM_VERSION	"2.1.1"

#define	CFG_READ		0		//Line is being read normally
#define	CFG_RELOAD		1		//Section is being parsed from the start
#define	CFG_DONE		2		//Section is done being parsed

#define DEFAULT_ARMOR		100

#define MAX_WEAPONS 		32 
#define MAX_SECONDARY 		8
#define MAX_PRIMARY 		18

#define CSDM_FFA_ENABLE		3
#define CSDM_FFA_DISABLE	2
#define CSDM_ENABLE			1
#define CSDM_DISABLE		0

#define CSDM_DROP_CONTINUE	0	//continue normally
#define CSDM_DROP_REMOVE	1	//remove the dropped weapon
#define CSDM_DROP_IGNORE	2	//ignore entirely

/************
 * FORWARDS *
 ************/
 
//Called when CSDM initializes.  It passes in a version string, or a blank
// string if some load failure occurred.
//Do pre-config stuff here.
forward csdm_Init(const version[]);

//Called when CSDM is ready to accept config hooks.
forward csdm_CfgInit();

//Called right before a death message is sent.  Return value has no effect.
forward csdm_PreDeath(killer, victim, headshot, const weapon[]);

//Called right after a death message is handled.  
//return PLUGIN_HANDLED will block CSDM from doing any physical respawning.
forward csdm_PostDeath(killer, victim, headshot, const weapon[]);

//Called after a player is physically respawned,
// but before the spawn handler is called.  Returning PLUGIN_HANDLED
// will block CSDM from calling the set spawn handler.
//Note! this will only be called if CSDM internally respawns or you use
// csdm_respawn().
forward csdm_PreSpawn(player, bool:fake);

//Called after a player is physically respawned, 
// and after all spawn handling is completed.
forward csdm_PostSpawn(player, bool:fake);

//Called right before round is restarted
//The post parameter is set to 1 if the event is post.
//If post is 0, the event is pre, and PLUGIN_HANDLED will block
// CSDM from doing round restart actions (respawning)
forward csdm_RoundRestart(post);

//Called when a CSDM state is set
forward csdm_StateChange(csdm_state);

/** 
 * Called when CSDM is about to remove a weapon.  Return PLUGIN_HANDLED to block.
 *
 * owner - The player who owned this weapon.
 * entity_id - The entity index of the weapon.
 * box_id - If the weapon is boxed, this will be set to the boxed entity index..
 */
forward csdm_RemoveWeapon(owner, entity_id, boxed_id);

//Called by the main plugin right now
//If death is true, the weapon was dropped on death
//if weapon is -1, the weapon is the shield.
forward csdm_HandleDrop(id, weapon, death);

/***********
 * NATIVES *
 ***********/
 
//To retrieve/set angles and v_angles, pass up to two more vectors
native csdm_getpos(player, Float:origin[3], ...);

native csdm_setpos(player, const Float:origin[3], ...);

//Returns the number of registered spawn styles
native csdm_spawnstyles();

//Retrieves the name of a spawn style by index (indices start at 0)
native csdm_styleinfo(style_index, name[], maxlength);

//Adds a spawn style handler
native csdm_addstyle(const name[], const function[]);

//Sets the current spawn style handler by name.
//The handler registered to this name will be called after every spawn.
native csdm_setstyle(const name[]);

//Returns the current style id
native csdm_curstyle();

//Respawns a player correctly under the CSDM spawn system.
native csdm_respawn(player);

//Forces a "fake" respawn on the player - sort of like a ResetHUD
native csdm_fakespawn(player);

//Registers a hook on the config reader
//The forward looks like this:
//forward my_cfg_reader(read_mode, const line[], const section[])
native csdm_reg_cfg(const sectionName[], const handler[]);

//Gives an item.  Same as give_item from fun.
native csdm_give_item(player, const item_name[]);

//Forces a player to drop a weapon
native csdm_force_drop(player, const weapon[], remove=1);

//Schedules a weapon for removal.  0 seconds means immediate
//delay specifies whether it should wait 0.1 seconds or not (0 for immediate lookup)
native csdm_remove_weapon(player, const weapon[], seconds, delay);

//Reloads the config file
//If you specify a named file, CSDM auto-prepends the configs dir.
// I.e., passing csdm\mapconfigs\de_dust2.cfg will turn into:
// addons\amxmodx\configs\csdm\mapconfigs\de_dust2.cfg
native csdm_reload_cfg(const file[]="");

//Returns whether CSDM is active
native csdm_active();
//Sets CSDM to active (do not set the cvar!)
native csdm_set_active(on_or_off);

//Returns/sets the current FFA (free for all) state
native csdm_get_ffa();
native csdm_set_ffa(on_or_off);

//Gets/sets the respawn wait time
native Float:csdm_get_spawnwait();
native csdm_set_spawnwait(Float:time);

//returns cache information into each array slot
// 0 - number of free items in spawn task cache
// 1 - number of free task in general task cache
// 2 - number of hot tasks (ones in use)
// 3 - number of cached weapon removals in table
// 4 - number of live weapon removals in table
// 5 - number of weapon find tasks in cache
// in general, 0+5+4 should about equal 1+2
// do not edit the vers parameter.
native csdm_cache(ar[6], vers=2)

//Quick hack to replace engine dependency and work around a FM bug
//returns 1 if a hull collision is found
native csdm_trace_hull(Float:origin[3], hull_no);

//Disables the CSDM welcome message
//This is useful if you only use CSDM as an engine
//Returns the old value.  Pass -1 to do nothing.
native csdm_set_intromsg(value=-1);

/**
 * Natives defined by csdm_main 
 */
 
//Returns the handle for the main CSDM menu, letting you modify it.
native csdm_main_menu();

#define CSDM_OPTION_SAYRESPAWN	1		//No extra parameters
#define CSDM_SET_DISABLED		-1
#define CSDM_SET_DEFAULT		0
#define CSDM_SET_ENABLED		1

//Sets an internal option.  Options listed above.
native csdm_set_mainoption(option, setting, ...);

//Runs through the weapon drop deletion algorithm.
//If weapon_id is -1, name should be "weapon_shield"
native csdm_fwd_drop(player, weapon_id, const name[]);

/*** ************ ***
 *** HELPER STUFF 
 ***/
 
#define	SLOT_PRIMARY	1
#define	SLOT_SECONDARY	2
#define	SLOT_KNIFE		3
#define	SLOT_GRENADE	4
#define	SLOT_C4			5

#define	_TEAM_T			1
#define	_TEAM_CT		2

//Weapon slot lookup table
stock g_WeaponSlots[] = {
		0,
		2,	//CSW_P228
		0,
		1,	//CSW_SCOUT
		4,	//CSW_HEGRENADE
		1,	//CSW_XM1014
		5,	//CSW_C4
		1,	//CSW_MAC10
		1,	//CSW_AUG
		4,	//CSW_SMOKEGRENADE
		2,	//CSW_ELITE
		2,	//CSW_FIVESEVEN
		1,	//CSW_UMP45
		1,	//CSW_SG550
		1,	//CSW_GALIL
		1,	//CSW_FAMAS
		2,	//CSW_USP
		2,	//CSW_GLOCK18
		1,	//CSW_AWP
		1,	//CSW_MP5NAVY
		1,	//CSW_M249
		1,	//CSW_M3
		1,	//CSW_M4A1
		1,	//CSW_TMP
		1,	//CSW_G3SG1
		4,	//CSW_FLASHBANG
		2,	//CSW_DEAGLE
		1,	//CSW_SG552
		1,	//CSW_AK47
		3,	//CSW_KNIFE
		1	//CSW_P90
	};
	
//Maximum backpack ammo lookup table
stock g_MaxBPAmmo[] = {
		0,
		52,	//CSW_P228
		0,
		90,	//CSW_SCOUT
		1,	//CSW_HEGRENADE
		32,	//CSW_XM1014
		1,	//CSW_C4
		100,//CSW_MAC10
		90,	//CSW_AUG
		1,	//CSW_SMOKEGRENADE
		120,//CSW_ELITE
		100,//CSW_FIVESEVEN
		100,//CSW_UMP45
		90,	//CSW_SG550
		90,	//CSW_GALIL
		90,	//CSW_FAMAS
		100,//CSW_USP
		120,//CSW_GLOCK18
		30,	//CSW_AWP
		120,//CSW_MP5NAVY
		200,//CSW_M249
		32,	//CSW_M3
		90,	//CSW_M4A1
		120,//CSW_TMP
		90,	//CSW_G3SG1
		2,	//CSW_FLASHBANG
		35,	//CSW_DEAGLE
		90,	//CSW_SG552
		90,	//CSW_AK47
		0,	//CSW_KNIFE
		100//CSW_P90
	};
	
#define getWepId(%1) get_weaponid(%1)

stock bool:IsValidTeam(team)
{
	if (team == 1 || team == 2)
		return true
	return false
}

stock drop_with_shield(player, weapon_id)
{
	new name[32]
	get_weaponname(weapon_id, name, 31)
	csdm_force_drop(player, "weapon_shield", 0)
	csdm_force_drop(player, name, 0)
	csdm_fwd_drop(player, -1, "weapon_shield")
	csdm_fwd_drop(player, weapon_id, name)
	csdm_give_item(player, "weapon_shield")
}
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
VD*
Membru, skill 0
Membru, skill 0
Posts: 4
Joined: 31 May 2017, 17:18
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: https://steamcommuni
Fond eXtream: 0
Location: Focşani
Contact:

15 May 2020, 15:17

Mersi yonu,a mers !
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests