This site is a testing version, but all data is shared with the live forum.


Raised This Month: $12 Target: $400
 3% 

Solved [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

Quote:
Originally Posted by Visan15 View Post
@v120kaaimcfg

Can you please do me one more favor ?

Can you add 3rd option to be Close menu and it close when press ? I know its on 0 (zero) but its more fast and easy if it will be on 3 .


1. Ak47 + Deagle
2. M4A1 + Deagle
3. Close menu
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_additem(g_iMenu, "Close menu")
}

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 || iItem == 2)
	{
		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")
	}
}
v120kaaimcfg 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 08:11.


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