#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Weapon Menu"
#define VERSION "1.0"
#define AUTHOR "Silent"
new gWPCT,gWPTE;
new g_showsec[33];
new bool:already[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
/*register_clcmd("say extraprofi", "playerspawn");*/
RegisterHam(Ham_Spawn, "player", "playerspawn", 1)
register_logevent("logevent_end", 2, "1=Round_End");
register_logevent("logevent_end", 2, "1&Restart_Round");
register_logevent("logevent_end", 2, "1=Game_Commencing");
}
public logevent_end()
{
gWPCT = 0;
gWPTE = 0;
new players[32], pnum
get_players(players, pnum)
for(new i=0; i<pnum; i++)
{
already[i] = false;
}
}
public playerspawn(id)
{
g_showsec[id] = 60;
already[id] = false;
fegyvermenu(id);
}
public fegyvermenu(id)
{
if(!is_user_alive(id)) return PLUGIN_HANDLED;
cs_set_user_money(id, 0); // Penz nullazasa
new string[200];
if(g_showsec[id] <= 60)
{
if(g_showsec[id] != 0)
{
if(already[id]) return PLUGIN_HANDLED;
set_task(1.0, "fegyvermenu",id);
g_showsec[id]--;
}
else
{
show_menu(id, 0, "^n", 1);
return PLUGIN_HANDLED;
}
}
if(!user_has_weapon(id, CSW_C4))
{
strip_user_weapons(id);
format(string, charsmax(string), "\\y.:Be4tBox:. \\rOnly\\dD2 \\rFegyverCsomagok! \\d[\\r%d \\ymp\\d]\\r, :", g_showsec[id]);
new menu = menu_create(string, "handler")
menu_additem(menu, "[\dM4A1 \yCsomag]", "1", 0);
menu_additem(menu, "[\dAK47 \yCsomag]", "2", 0);
menu_additem(menu, "[\dAWP \yCsomag]\d \w» [\rElső 6 embernek!\d]", "3", 0);
menu_additem(menu, "[\dMachineGun \yCsomag]", "4", 0);
menu_additem(menu, "[\dAUG \yCsomag]", "5", 0);
menu_additem(menu, "[\dFAMAS \yCsomag]", "6", 0);
menu_additem(menu, "[\dGalil \yCsomag]", "7", 0);
menu_additem(menu, "[\dSMG \yCsomag]", "8", 0);
menu_additem(menu, "[\dAutoshotgun \yCsomag] \r[\yXM1014\d]", "9", 0);
menu_additem(menu, "[\dShotgun \yCsomag] \r[\yM3\d]", "10", 0);
menu_additem(menu, "[\dScout \yCsomag]", "11", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu);
}
else
{
format(string, charsmax(string), "\\y.:Be4tBox:. \\rOnly\\dD2 \\rFegyverCsomagok! \\d[\\r%d \\ymp\\d]\\r, :", g_showsec[id]);
new menu = menu_create(string, "handler")
menu_additem(menu, "[\dM4A1 \yCsomag]", "1", 0);
menu_additem(menu, "[\dAK47 \yCsomag]", "2", 0);
menu_additem(menu, "[\dAWP \yCsomag]\d \w~ [\rElső 6 embernek!\d]", "3", 0);
menu_additem(menu, "[\dMachineGun \yCsomag]", "4", 0);
menu_additem(menu, "[\dAUG \yCsomag]", "5", 0);
menu_additem(menu, "[\dFAMAS \yCsomag]", "6", 0);
menu_additem(menu, "[\dGalil \yCsomag]", "7", 0);
menu_additem(menu, "[\dSMG \yCsomag]", "8", 0);
menu_additem(menu, "[\dAutoshotgun \yCsomag] \r[\yXM1014\d]", "9", 0);
menu_additem(menu, "[\dShotgun \yCsomag] \r[\yM3\d]", "10", 0);
menu_additem(menu, "[\dScout \yCsomag]", "11", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu);
}
return PLUGIN_HANDLED;
}
public handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
already[id] = true;
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:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "weapon_m4a1");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4M4A1 ^1Csomagot!");
}
case 2:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "weapon_ak47");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4AK47 ^1Csomagot!");
}
case 3:
{
new CsTeams:userTeam = cs_get_user_team(id);
if(userTeam == CS_TEAM_CT)
{
if(gWPCT < 6)
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_awp");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_338magnum");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4AWP ^1Csomagot!");
gWPCT++
}
else
{
set_hudmessage(42, 255, 212, 0.27, 0.26, 0, 6.0, 2.1)
show_hudmessage(id, "Buzeránt!^nMár nincs WP!");
fegyvermenu(id);
}
}
if(userTeam == CS_TEAM_T)
{
if(gWPTE < 6)
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_awp");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_338magnum");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4AWP ^1Csomagot!");
gWPTE++
}
else
{
set_hudmessage(42, 255, 212, 0.27, 0.26, 0, 6.0, 2.1)
show_hudmessage(id, "Buzeránt!^nMá nincs WP");
fegyvermenu(id);
}
}
}
case 4:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "weapon_m249");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4Machinegun ^1Csomagot!");
}
case 5:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_aug");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4AUG ^1Csomagot!");
}
case 6:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_famas");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4Famas ^1Csomagot!");
}
case 7:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_galil");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4Galil ^1Csomagot!");
}
case 8:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_mp5navy");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4SMG ^1Csomagot!");
}
case 9:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_xm1014");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_buckshot");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4Autoshutgun ^1Csomagot!");
}
case 10:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_m3");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_buckshot");
ColorChat(id, RED, "^4.:Be4tBox:. » ^3Kaptál egy ^4Shotgun ^1Csomagot!");
}
case 11:
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae")
give_item(id, "weapon_scout");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
ColorChat(id, BLUE, "^4.:Be4tBox:. » ^3Kaptál egy ^4Scout ^3Csomagot!");
}
}
return PLUGIN_HANDLED;
}
stock give_player_grenades(index)
{
give_item(index, "weapon_hegrenade");
give_item(index, "weapon_flashbang");
give_item(index, "weapon_flashbang");
give_item(index, "item_thighpack");
give_item(index, "item_assaultsuit");
}