|
CS1.BG | DUST2 NOSHTA GARMI [RANKED PLAY] #1 45.144.155.113:27015 |
de_dust2 Играчи: 30/32 |
VIP
|
Cs-PlovdiV.com - Aim Attack | 93.123.16.4:27022 | aim_aztec | Играчи: 0/16 |
|
VIP
|
93.123.16.4:27022 | Cs-PlovdiV.com - Aim Attack | aim_aztec | 0/16 |
A few Questions about Weapon Menu and so one
-
AssaultStars
Извън линия - Потребител
- Мнения: 6
- Регистриран на: 02 Окт 2023, 03:58
A few Questions about Weapon Menu and so one
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 } */
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
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
Код за потвърждение: Избери целия код
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
Както съм го написал няма ли да се повтори само веднъж ? Или трябва както ти си посочил, за да е по сигурно ?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
Както съм посочил е правилния начин.
Код за потвърждение: Избери целия код
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
произошла ошибка.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
Никакой ошибки нет. Вы предоставили такой плагин, в который добавлен только таймер на 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
Здравствуйте уважаемые, прошу меня извинить.
Я скопировал не тот sma-файл. Я, к сожалению, новичок в этом деле... и нервничаю с кодами. Я перепробовал несколько меню оружия и взял не то.
Теперь вот правильное. Здесь должны быть эти 15 секунд... и все. Я пытался скопировать с вашего, но не получилось.
Спасибо
Я скопировал не тот 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
Код за потвърждение: Избери целия код
#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
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 7 Отговори
- 2548 Преглеждания
-
Последно мнение от Siska
-
- 0 Отговори
- 1347 Преглеждания
-
Последно мнение от GGzBoy
-
- 0 Отговори
- 1395 Преглеждания
-
Последно мнение от GGzBoy
-
- 10 Отговори
- 4162 Преглеждания
-
Последно мнение от GGzBoy
-
- 0 Отговори
- 473 Преглеждания
-
Последно мнение от jesusaliso
-
- 3 Отговори
- 390 Преглеждания
-
Последно мнение от Krasimir
-
- 0 Отговори
- 1021 Преглеждания
-
Последно мнение от vini2001
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 2 госта