Raised This Month: $ Target: $400
 0% 

[REQ] Weapons menu


Post New Thread Reply   
 
Thread Tools Display Modes
v120kaaimcfg
Member
Join Date: Apr 2024
Old 05-27-2024 , 18:16   Re: [REQ] Weapons menu
Reply With Quote #11

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Last edited by v120kaaimcfg; 06-01-2024 at 12:29.
v120kaaimcfg is offline
Visan15
Junior Member
Join Date: Apr 2012
Old 06-10-2024 , 13:47   Re: [REQ] Weapons menu
Reply With Quote #12

@v120kaaimcfg

Sorry i was away. Can you still help me with please ?
Visan15 is offline
Visan15
Junior Member
Join Date: Apr 2012
Old Yesterday , 13:28   Re: [REQ] Weapons menu
Reply With Quote #13

Anyone can help me please to adding Close menu option ?

Thank you
Visan15 is offline
731
Member
Join Date: Aug 2006
Old Yesterday , 15:07   Re: [REQ] Weapons menu
Reply With Quote #14

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

new bool:HasC4[33]

public plugin_init()
{
	register_plugin( "Weapons Menu", "1.0", "731" )
	
	register_event( "ResetHUD", "ShowMenu", "be" )
	
	register_menucmd(register_menuid("Weapons"), 1023, "MenuCommand" )
	
	set_msg_block(get_user_msgid("TextMsg"), BLOCK_SET)
}

public ShowMenu( id )
{
	new szMenuBody[512]
	new keys
	
	new nLen = format( szMenuBody, 511, "\y【\rSelect your weapons:\y】^n" )
	
	nLen += format( szMenuBody[nLen], 511-nLen, "^n\r1. \wAK47 + DesertEagle" )
	nLen += format( szMenuBody[nLen], 511-nLen, "^n\r2. \wM4A1 + DesertEagle" )
	nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\r3. \wExit" )
	
	keys = (1<<0|1<<1|1<<2)
	
	show_menu( id, keys, szMenuBody, 10, "Weapons" )
	
	return PLUGIN_CONTINUE
}

public MenuCommand( id, key )
{
	
	switch( key ){
		
		case 0: 
		{
			if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
				HasC4[id] = true
			else
				HasC4[id] = false
			strip_user_weapons(id)
			give_item(id,"weapon_knife")
			cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
			give_item(id, "weapon_ak47")
			give_item(id, "ammo_762nato")
			give_item(id, "ammo_762nato")
			give_item(id, "ammo_762nato")
			give_item(id, "weapon_deagle")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			if (HasC4[id])
			{
				give_item(id, "weapon_c4")
				cs_set_user_plant( id, 1, 1 )
				cs_set_user_submodel(id, 1)
			}
		}
		case 1: 
		{
			if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
				HasC4[id] = true
			else
				HasC4[id] = false
			strip_user_weapons(id)
			give_item(id,"weapon_knife")
			cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
			give_item(id, "weapon_m4a1")
			give_item(id, "ammo_556nato")
			give_item(id, "ammo_556nato")
			give_item(id, "ammo_556nato")
			give_item(id, "weapon_deagle")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			give_item(id, "ammo_50ae")
			if (HasC4[id])
			{
				give_item(id, "weapon_c4")
				cs_set_user_plant( id, 1, 1 )
				cs_set_user_submodel(id, 1)
			}
		}
		case 2: 
		{
			return PLUGIN_HANDLED
		}
	}
	
	return PLUGIN_HANDLED
}
731 is offline
Visan15
Junior Member
Join Date: Apr 2012
Old Yesterday , 20:27   Re: [REQ] Weapons menu
Reply With Quote #15

Can you do it in this code please ? :

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

new g_iMenu

public plugin_init()
{
	register_plugin("Weapons Menu", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
	CreateMenu()
}

CreateMenu()
{
	g_iMenu = menu_create("Select your \rweapons\y!", "Menu_Handler")
	menu_additem(g_iMenu, "\wAK47 \y+ \wDeagle")
	menu_additem(g_iMenu, "\wM4A1 \y+ \wDeagle")
}

public OnPlayerSpawn(id)
{
	if(!is_user_alive(id))
	{
		return
	}

	menu_display(id, g_iMenu)

	remove_task(id+123456)
	set_task(10.0, "cancel_menu", id+123456)
}

public Menu_Handler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		return
	}

	remove_task(id+123456)

	strip_user_weapons(id)
	set_pdata_cbase(id, 116, 0)

	switch(iItem)
	{
		case 0:
		{
			give_item(id, "weapon_ak47")
			cs_set_user_bpammo(id, CSW_AK47, 90)
		}
		case 1:
		{
			give_item(id, "weapon_m4a1")
			cs_set_user_bpammo(id, CSW_M4A1, 90)
		}
	}

	give_item(id, "weapon_knife")
	give_item(id, "weapon_deagle")
	cs_set_user_bpammo(id, CSW_DEAGLE, 35)

	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		give_item(id, "item_thighpack")
	}
}

public cancel_menu(id)
{
	if(is_user_connected(id-123456))
	{
		menu_cancel(id-123456)
		client_cmd(id-123456, "slot10")
	}
}
Visan15 is offline
Tote
Senior Member
Join Date: Jul 2023
Old Today , 05:14   Re: [REQ] Weapons menu
Reply With Quote #16

Quote:
Originally Posted by Visan15 View Post
Can you do it in this code please ? :

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

new g_iMenu

public plugin_init()
{
	register_plugin("Weapons Menu", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
	CreateMenu()
}

CreateMenu()
{
	g_iMenu = menu_create("Select your \rweapons\y!", "Menu_Handler")
	menu_additem(g_iMenu, "\wAK47 \y+ \wDeagle")
	menu_additem(g_iMenu, "\wM4A1 \y+ \wDeagle")
}

public OnPlayerSpawn(id)
{
	if(!is_user_alive(id))
	{
		return
	}

	menu_display(id, g_iMenu)

	remove_task(id+123456)
	set_task(10.0, "cancel_menu", id+123456)
}

public Menu_Handler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		return
	}

	remove_task(id+123456)

	strip_user_weapons(id)
	set_pdata_cbase(id, 116, 0)

	switch(iItem)
	{
		case 0:
		{
			give_item(id, "weapon_ak47")
			cs_set_user_bpammo(id, CSW_AK47, 90)
		}
		case 1:
		{
			give_item(id, "weapon_m4a1")
			cs_set_user_bpammo(id, CSW_M4A1, 90)
		}
	}

	give_item(id, "weapon_knife")
	give_item(id, "weapon_deagle")
	cs_set_user_bpammo(id, CSW_DEAGLE, 35)

	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		give_item(id, "item_thighpack")
	}
}

public cancel_menu(id)
{
	if(is_user_connected(id-123456))
	{
		menu_cancel(id-123456)
		client_cmd(id-123456, "slot10")
	}
}
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

new g_iMenu

public plugin_init()
{
	register_plugin("Weapons Menu", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
	CreateMenu()
}

CreateMenu()
{
	g_iMenu = menu_create("Select your \rweapons\y!", "Menu_Handler")
	menu_additem(g_iMenu, "\wAK47 \y+ \wDeagle")
	menu_additem(g_iMenu, "\wM4A1 \y+ \wDeagle")
	
	menu_setprop(g_iMenu, MPROP_EXIT, MEXIT_ALL)
}

public OnPlayerSpawn(id)
{
	if(!is_user_alive(id))
	{
		return
	}

	menu_display(id, g_iMenu)

	remove_task(id+123456)
	set_task(10.0, "cancel_menu", id+123456)
}

public Menu_Handler(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		return
	}

	remove_task(id+123456)

	strip_user_weapons(id)
	set_pdata_cbase(id, 116, 0)

	switch(iItem)
	{
		case 0:
		{
			give_item(id, "weapon_ak47")
			cs_set_user_bpammo(id, CSW_AK47, 90)
		}
		case 1:
		{
			give_item(id, "weapon_m4a1")
			cs_set_user_bpammo(id, CSW_M4A1, 90)
		}
	}

	give_item(id, "weapon_knife")
	give_item(id, "weapon_deagle")
	cs_set_user_bpammo(id, CSW_DEAGLE, 35)

	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		give_item(id, "item_thighpack")
	}
}

public cancel_menu(id)
{
	if(is_user_connected(id-123456))
	{
		menu_cancel(id-123456)
		client_cmd(id-123456, "slot10")
	}
}
Tote is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:32.


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