Counter-Strike 1.6
CS1.BG | DUST2 NOSHTA GARMI [RANKED PLAY] #1
45.144.155.113:27015
de_dust2
Играчи: 30/32
de_dust2
Counter-Strike 1.6
VIP
Cs-PlovdiV.com - Aim Attack 93.123.16.4:27022 aim_aztec Играчи: 0/16
Counter-Strike 1.6
VIP
93.123.16.4:27022 Cs-PlovdiV.com - Aim Attack aim_aztec 0/16

A few Questions about Weapon Menu and so one

Въпроси и проблеми свързани с AMXModX.
Аватар
AssaultStars
Извън линия
Потребител
Потребител
Мнения: 6
Регистриран на: 02 Окт 2023, 03:58

A few Questions about Weapon Menu and so one

Мнение от AssaultStars » 02 Окт 2023, 04:07

I have a Weapon Menu.
It is good. But I want it to disappear after 15 seconds. How do I do that?

I still have 2 questions about FastDL "can it go in here or which category"?

/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fakemeta> #include <fun> #define PLUGIN "WPMENU" #define VERSION "1.0" #define AUTHOR "Xevious" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam( Ham_Spawn, "player", "wps", 1 ); RegisterHam( Ham_Spawn, "player", "wpmenu", 1); } public wps(id) { if(is_user_alive(id) ) { strip_user_weapons(id) set_pdata_int(id, 116, 0) give_item(id, "weapon_knife") switch(cs_get_user_team(id) ) { case CS_TEAM_T: { give_item(id, "weapon_ak47") give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_AK47, 90) cs_set_user_bpammo(id, CSW_GLOCK18, 120) } case CS_TEAM_CT: { give_item(id, "weapon_m4a1") give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_M4A1, 90) cs_set_user_bpammo(id, CSW_USP, 100) } } give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") cs_set_user_money (id, 0) } } public wpmenu(id) { new menu = menu_create("\rWeapons Menu", "menu_handler"); menu_additem(menu, "\wAK + USP + HE + FB", "1", 0); menu_additem(menu, "\wM4 + GlOCK18 + HE + FB", "2", 0); menu_additem(menu, "\wAWP + DEAGLE + HE + FB", "3", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public menu_handler(id, menu, item) { //we don't want to deal with them if they exited a menu if( item == MENU_EXIT ) { menu_destroy(menu); give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_USP, 100) return PLUGIN_HANDLED; } //now lets create some variables that will give us information about the menu and the item that was pressed/chosen new data[6], iName[64]; new access, callback; //heres the function that will give us that information (since it doesnt magicaly appear) menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); //Note - that you can do this next step how you want, this is just the way I prefer //looking back to menu_additem, we sent data with every item we added, this is where it gets a little fishy for us (where you can do your own method) new key = str_to_num(data); //note that all my datas were numbers (you can do it with whatever type of string you want) //now lets find which item was pressed switch(key) { case 1: { strip_user_weapons(id) set_pdata_int(id, 116, 0) give_item(id, "weapon_knife") give_item(id, "weapon_ak47") give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_AK47, 90) cs_set_user_bpammo(id, CSW_GLOCK18, 120) give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") //note that if we dont want to continue through the function, we can't just end with a return. We want to kill the menu first menu_destroy(menu); return PLUGIN_HANDLED; } case 2: { strip_user_weapons(id) set_pdata_int(id, 116, 0) give_item(id, "weapon_knife") give_item(id, "weapon_akm4a1") give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_M4A1, 30) cs_set_user_bpammo(id, CSW_USP, 35) give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") } case 3: //again i don't have experience with the admin limitations, so i don't know if you need to have a check before this (im assuming you don't though ^_^) { strip_user_weapons(id) set_pdata_int(id, 116, 0) give_item(id, "weapon_knife") give_item(id, "weapon_awp") give_item(id, "weapon_deagle") cs_set_user_bpammo(id, CSW_AWP, 30) cs_set_user_bpammo(id, CSW_DEAGLE, 35) give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") } } //lets finish up this function with a menu_destroy, and a return menu_destroy(menu); return PLUGIN_HANDLED; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par } */

Аватар
Radeon
Извън линия
Потребител
Потребител
Мнения: 143
Регистриран на: 04 Апр 2021, 11:30
Се отблагодари: 2 пъти
Получена благодарност: 34 пъти
Обратна връзка:

Re: A few Questions about Weapon Menu and so one

Мнение от Radeon » 02 Окт 2023, 10:14

Test it

Код за потвърждение: Избери целия код

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

#define PLUGIN "WPMENU"
#define VERSION "1.0"
#define AUTHOR "Xevious"

new CvarMenuRemove;


public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam( Ham_Spawn, "player", "wps", 1 );
	RegisterHam( Ham_Spawn, "player", "wpmenu", 1);
	CvarMenuRemove	= register_cvar( "wp_menuremove", "15" );
}

public wps(id)
{
	if(is_user_alive(id) )
	{
		strip_user_weapons(id)
		set_pdata_int(id, 116, 0)
		give_item(id, "weapon_knife")
		
		switch(cs_get_user_team(id) )
		{
			case CS_TEAM_T:
			{
				give_item(id, "weapon_ak47")
				give_item(id, "weapon_glock18")
				cs_set_user_bpammo(id, CSW_AK47, 90)
				cs_set_user_bpammo(id, CSW_GLOCK18, 120)                
			}
			case CS_TEAM_CT:
			{
				give_item(id, "weapon_m4a1")
				give_item(id, "weapon_usp")
				cs_set_user_bpammo(id, CSW_M4A1, 90)
				cs_set_user_bpammo(id, CSW_USP, 100) 
			}
		}
		give_item(id, "weapon_hegrenade")
		give_item(id, "weapon_flashbang")
		
		cs_set_user_money (id, 0)
	}
}  


public wpmenu(id)
{
	new menu = menu_create("\rWeapons Menu", "menu_handler");
	menu_additem(menu, "\wAK + USP + HE + FB", "1", 0);
	menu_additem(menu, "\wM4 + GlOCK18 + HE + FB", "2", 0);
	menu_additem(menu, "\wAWP + DEAGLE + HE + FB", "3", 0);
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	set_task( get_pcvar_float( CvarMenuRemove ), "RemoveMenu", id );
}

public RemoveMenu( id )
{
	show_menu( id, 0, "^n", 1 );
}

public menu_handler(id, menu, item)
{
	//we don't want to deal with them if they exited a menu
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		give_item(id, "weapon_usp")
		cs_set_user_bpammo(id, CSW_USP, 100)
		return PLUGIN_HANDLED;
	}
	
	//now lets create some variables that will give us information about the menu and the item that was pressed/chosen
	new data[6], iName[64];
	new access, callback;
	//heres the function that will give us that information (since it doesnt magicaly appear)
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	//Note - that you can do this next step how you want, this is just the way I prefer
	
	//looking back to menu_additem, we sent data with every item we added, this is where it gets a little fishy for us (where you can do your own method)
	new key = str_to_num(data);
	//note that all my datas were numbers (you can do it with whatever type of string you want)
	
	//now lets find which item was pressed
	switch(key)
	{
		case 1:
		{
			
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			give_item(id, "weapon_ak47")
			give_item(id, "weapon_glock18")
			cs_set_user_bpammo(id, CSW_AK47, 90)
			cs_set_user_bpammo(id, CSW_GLOCK18, 120)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
			//note that if we dont want to continue through the function, we can't just end with a return. We want to kill the menu first
			menu_destroy(menu);
			return PLUGIN_HANDLED;
		}
		case 2:
		{
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			
			give_item(id, "weapon_akm4a1")
			give_item(id, "weapon_usp")
			cs_set_user_bpammo(id, CSW_M4A1, 30)
			cs_set_user_bpammo(id, CSW_USP, 35)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
		}
		case 3: //again i don't have experience with the admin limitations, so i don't know if you need to have a check before this (im assuming you don't though ^_^)
		{
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			give_item(id, "weapon_awp")
			give_item(id, "weapon_deagle")
			cs_set_user_bpammo(id, CSW_AWP, 30)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
		}
	}
	
	//lets finish up this function with a menu_destroy, and a return
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/

Аватар
Hurricane
На линия
Потребител
Потребител
Мнения: 198
Регистриран на: 04 Юни 2022, 21:18
Се отблагодари: 17 пъти
Получена благодарност: 71 пъти

Re: A few Questions about Weapon Menu and so one

Мнение от Hurricane » 02 Окт 2023, 11:51

Код за потвърждение: Избери целия код

 
set_task( get_pcvar_float( CvarMenuRemove ), "RemoveMenu", id , _, _, "a", 1);

Аватар
Radeon
Извън линия
Потребител
Потребител
Мнения: 143
Регистриран на: 04 Апр 2021, 11:30
Се отблагодари: 2 пъти
Получена благодарност: 34 пъти
Обратна връзка:

Re: A few Questions about Weapon Menu and so one

Мнение от Radeon » 02 Окт 2023, 17:15

Hurricane написа: 02 Окт 2023, 11:51

Код за потвърждение: Избери целия код

 
set_task( get_pcvar_float( CvarMenuRemove ), "RemoveMenu", id , _, _, "a", 1);
Както съм го написал няма ли да се повтори само веднъж ? Или трябва както ти си посочил, за да е по сигурно ?

Аватар
Hurricane
На линия
Потребител
Потребител
Мнения: 198
Регистриран на: 04 Юни 2022, 21:18
Се отблагодари: 17 пъти
Получена благодарност: 71 пъти

Re: A few Questions about Weapon Menu and so one

Мнение от Hurricane » 02 Окт 2023, 18:14

Както съм посочил е правилния начин.

Код за потвърждение: Избери целия код

native set_task(Float:time, const function[], id = 0, const any:parameter[] = "", len = 0, const flags[] = "", repeat = 0);

Аватар
AssaultStars
Извън линия
Потребител
Потребител
Мнения: 6
Регистриран на: 02 Окт 2023, 03:58

Re: A few Questions about Weapon Menu and so one

Мнение от AssaultStars » 04 Окт 2023, 03:06

Radeon написа: 02 Окт 2023, 10:14 Test it

Код за потвърждение: Избери целия код

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

#define PLUGIN "WPMENU"
#define VERSION "1.0"
#define AUTHOR "Xevious"

new CvarMenuRemove;


public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam( Ham_Spawn, "player", "wps", 1 );
	RegisterHam( Ham_Spawn, "player", "wpmenu", 1);
	CvarMenuRemove	= register_cvar( "wp_menuremove", "15" );
}

public wps(id)
{
	if(is_user_alive(id) )
	{
		strip_user_weapons(id)
		set_pdata_int(id, 116, 0)
		give_item(id, "weapon_knife")
		
		switch(cs_get_user_team(id) )
		{
			case CS_TEAM_T:
			{
				give_item(id, "weapon_ak47")
				give_item(id, "weapon_glock18")
				cs_set_user_bpammo(id, CSW_AK47, 90)
				cs_set_user_bpammo(id, CSW_GLOCK18, 120)                
			}
			case CS_TEAM_CT:
			{
				give_item(id, "weapon_m4a1")
				give_item(id, "weapon_usp")
				cs_set_user_bpammo(id, CSW_M4A1, 90)
				cs_set_user_bpammo(id, CSW_USP, 100) 
			}
		}
		give_item(id, "weapon_hegrenade")
		give_item(id, "weapon_flashbang")
		
		cs_set_user_money (id, 0)
	}
}  


public wpmenu(id)
{
	new menu = menu_create("\rWeapons Menu", "menu_handler");
	menu_additem(menu, "\wAK + USP + HE + FB", "1", 0);
	menu_additem(menu, "\wM4 + GlOCK18 + HE + FB", "2", 0);
	menu_additem(menu, "\wAWP + DEAGLE + HE + FB", "3", 0);
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	set_task( get_pcvar_float( CvarMenuRemove ), "RemoveMenu", id );
}

public RemoveMenu( id )
{
	show_menu( id, 0, "^n", 1 );
}

public menu_handler(id, menu, item)
{
	//we don't want to deal with them if they exited a menu
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		give_item(id, "weapon_usp")
		cs_set_user_bpammo(id, CSW_USP, 100)
		return PLUGIN_HANDLED;
	}
	
	//now lets create some variables that will give us information about the menu and the item that was pressed/chosen
	new data[6], iName[64];
	new access, callback;
	//heres the function that will give us that information (since it doesnt magicaly appear)
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	//Note - that you can do this next step how you want, this is just the way I prefer
	
	//looking back to menu_additem, we sent data with every item we added, this is where it gets a little fishy for us (where you can do your own method)
	new key = str_to_num(data);
	//note that all my datas were numbers (you can do it with whatever type of string you want)
	
	//now lets find which item was pressed
	switch(key)
	{
		case 1:
		{
			
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			give_item(id, "weapon_ak47")
			give_item(id, "weapon_glock18")
			cs_set_user_bpammo(id, CSW_AK47, 90)
			cs_set_user_bpammo(id, CSW_GLOCK18, 120)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
			//note that if we dont want to continue through the function, we can't just end with a return. We want to kill the menu first
			menu_destroy(menu);
			return PLUGIN_HANDLED;
		}
		case 2:
		{
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			
			give_item(id, "weapon_akm4a1")
			give_item(id, "weapon_usp")
			cs_set_user_bpammo(id, CSW_M4A1, 30)
			cs_set_user_bpammo(id, CSW_USP, 35)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
		}
		case 3: //again i don't have experience with the admin limitations, so i don't know if you need to have a check before this (im assuming you don't though ^_^)
		{
			strip_user_weapons(id)
			set_pdata_int(id, 116, 0)
			give_item(id, "weapon_knife")
			
			give_item(id, "weapon_awp")
			give_item(id, "weapon_deagle")
			cs_set_user_bpammo(id, CSW_AWP, 30)
			cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
		}
	}
	
	//lets finish up this function with a menu_destroy, and a return
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/
произошла ошибка.

Таким образом, на СТ вы можете купить Ак 47
но не можете купить M4A1 в T.
Неважно, кто где находится, каждый должен иметь возможность выбора.
Если вы нажимаете M4A1 в T, то AK 47 тоже исчезает... и у вас остается 0$. Было бы здорово, если бы все это работало и у вас оставалось 16000$. Спасибо

Аватар
Radeon
Извън линия
Потребител
Потребител
Мнения: 143
Регистриран на: 04 Апр 2021, 11:30
Се отблагодари: 2 пъти
Получена благодарност: 34 пъти
Обратна връзка:

Re: A few Questions about Weapon Menu and so one

Мнение от Radeon » 04 Окт 2023, 10:31

Никакой ошибки нет. Вы предоставили такой плагин, в который добавлен только таймер на 15 секунд.В первом варианте, который вы дали, указан cs_set_user_money(id, 0). В результате деньги игрока равны 0. Подумайте, чего именно вы хотите, и запишите это. Никто не будет переделывать за вас код по 100 раз.

Аватар
AssaultStars
Извън линия
Потребител
Потребител
Мнения: 6
Регистриран на: 02 Окт 2023, 03:58

Re: A few Questions about Weapon Menu and so one

Мнение от AssaultStars » 04 Окт 2023, 12:17

Здравствуйте уважаемые, прошу меня извинить.
Я скопировал не тот sma-файл. Я, к сожалению, новичок в этом деле... и нервничаю с кодами. Я перепробовал несколько меню оружия и взял не то.

Теперь вот правильное. Здесь должны быть эти 15 секунд... и все. Я пытался скопировать с вашего, но не получилось.

Спасибо :)

Код за потвърждение: Избери целия код

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

new const PLUGIN[] = "Weapons menu"; 
new const VERSION[] = "1.0"; 
new const AUTHOR[] = "~D4rkSiD3Rs~"; 

new bool: WeaponChosen[33]; 

public plugin_init() 
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR); 

    register_clcmd("weapons", "WeaponMenu"); 
    register_clcmd("say /weapons", "WeaponMenu") 

    RegisterHam(Ham_Spawn, "player", "Spawn", 1); 
} 

public client_putinserver(id) 
{ 
    WeaponChosen[id] = false; 
} 

public Spawn(id) 
{ 
    if(is_user_alive(id)) 
    { 
        WeaponChosen[id] = false; 
        WeaponMenu(id); 
    } 
} 

public WeaponMenu(id) 
{ 
    if(WeaponChosen[id]) 
        return PLUGIN_HANDLED; 

    new menu = menu_create ("Weapons Menu", "MenuHandler"); 

    menu_additem(menu, "AK47 + Deagle", "1"); 
    menu_additem(menu, "M4A1 + Deagle", "2"); 
    menu_additem(menu, "AWP + Deagle", "3"); 

    menu_display(id, menu, 0 ); 
    return 1;  
} 

public MenuHandler(id, menu, item) 
{ 
    if(item == MENU_EXIT) 
    { 
        return 1; 
    } 
     
    new data [6], szName [64]; 
    new access, callback; 
    menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback); 
    new key = str_to_num (data); 
     
    switch (key) 
    { 
        case 1: 
        { 
            WeaponChosen[id] = true; 
            give_item(id, "weapon_deagle"); 
            cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
            give_item(id, "weapon_ak47"); 
            cs_set_user_bpammo(id, CSW_AK47, 90); 
            give_item (id, "weapon_hegrenade");
	   give_item (id, "weapon_flashbang");
        } 
        case 2: 
        { 
            WeaponChosen[id] = true; 
            give_item(id, "weapon_deagle"); 
            cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
            give_item(id, "weapon_m4a1"); 
            cs_set_user_bpammo(id, CSW_M4A1, 90); 
            give_item (id, "weapon_hegrenade");
	   give_item (id, "weapon_flashbang");
        } 
        case 3: 
        { 
            WeaponChosen[id] = true; 
            give_item(id, "weapon_deagle"); 
            cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
            give_item(id, "weapon_awp"); 
            cs_set_user_bpammo(id, CSW_AWP, 90); 
            give_item (id, "weapon_hegrenade");
	   give_item (id, "weapon_flashbang");


        } 
    } 
     
    menu_destroy (menu); 
    return 1; 
}  

Аватар
Radeon
Извън линия
Потребител
Потребител
Мнения: 143
Регистриран на: 04 Апр 2021, 11:30
Се отблагодари: 2 пъти
Получена благодарност: 34 пъти
Обратна връзка:

Re: A few Questions about Weapon Menu and so one

Мнение от Radeon » 04 Окт 2023, 14:26

Код за потвърждение: Избери целия код

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

new const PLUGIN[] = "Weapons menu"; 
new const VERSION[] = "1.0"; 
new const AUTHOR[] = "~D4rkSiD3Rs~"; 

new bool: WeaponChosen[33]; 
new CvarMenuRemove;

public plugin_init() 
{ 
	register_plugin(PLUGIN, VERSION, AUTHOR); 
	
	register_clcmd("weapons", "WeaponMenu"); 
	register_clcmd("say /weapons", "WeaponMenu") 
	
	RegisterHam(Ham_Spawn, "player", "Spawn", 1); 
	CvarMenuRemove	= register_cvar( "wp_menuremove", "15" );
} 

public client_putinserver(id) 
{ 
	WeaponChosen[id] = false; 
} 

public Spawn(id) 
{ 
	if(is_user_alive(id)) 
	{ 
		WeaponChosen[id] = false; 
		WeaponMenu(id); 
	} 
} 

public WeaponMenu(id) 
{ 
	if(WeaponChosen[id]) 
		return PLUGIN_HANDLED; 
	
	new menu = menu_create ("Weapons Menu", "MenuHandler"); 
	
	menu_additem(menu, "AK47 + Deagle", "1"); 
	menu_additem(menu, "M4A1 + Deagle", "2"); 
	menu_additem(menu, "AWP + Deagle", "3"); 
	
	menu_display(id, menu, 0 ); 
	set_task( get_pcvar_float( CvarMenuRemove ), "RemoveMenu", id , _, _, "a", 1);
	return 1;  
} 

public RemoveMenu( id )
{
	show_menu( id, 0, "^n", 1 );
}

public MenuHandler(id, menu, item) 
{ 
	if(item == MENU_EXIT) 
	{ 
		return 1; 
	} 
	
	new data [6], szName [64]; 
	new access, callback; 
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback); 
	new key = str_to_num (data); 
	
	switch (key) 
	{ 
		case 1: 
		{ 
			WeaponChosen[id] = true; 
			give_item(id, "weapon_deagle"); 
			cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
			give_item(id, "weapon_ak47"); 
			cs_set_user_bpammo(id, CSW_AK47, 90); 
			give_item (id, "weapon_hegrenade");
			give_item (id, "weapon_flashbang");
		} 
		case 2: 
		{ 
			WeaponChosen[id] = true; 
			give_item(id, "weapon_deagle"); 
			cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
			give_item(id, "weapon_m4a1"); 
			cs_set_user_bpammo(id, CSW_M4A1, 90); 
			give_item (id, "weapon_hegrenade");
			give_item (id, "weapon_flashbang");
		} 
		case 3: 
		{ 
			WeaponChosen[id] = true; 
			give_item(id, "weapon_deagle"); 
			cs_set_user_bpammo(id, CSW_DEAGLE, 90); 
			give_item(id, "weapon_awp"); 
			cs_set_user_bpammo(id, CSW_AWP, 90); 
			give_item (id, "weapon_hegrenade");
			give_item (id, "weapon_flashbang");
			
			
		} 
	} 
	
	menu_destroy (menu); 
	return 1; 
}  

Аватар
AssaultStars
Извън линия
Потребител
Потребител
Мнения: 6
Регистриран на: 02 Окт 2023, 03:58

Re: A few Questions about Weapon Menu and so one

Мнение от AssaultStars » 05 Окт 2023, 08:04

perfect my friend! Thank you so much! x3

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Поддръжка / Помощ”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 2 госта