Member
Join Date: Jan 2022
Location: Palestine
|
09-29-2022
, 00:26
Requst Edite Sma
|
#1
|
Hello EveryBuddy
here is sma if normal weapon menu , when i add it on the server , it should appear the normal weapons menu for players when they respawned as human only
but it doesnot appear untill you type on console "weapon" .. and the 2nd bug is that this menu should be used for 1 time , Exampe : when player use the appeared menu on The beginning of the tour and choose a weapon , they can't use it again when they use it from game menu "M>2>1" and they will get massage "You already bought a weapon"
so guys i hope somone could help me on that , and big thanks for you
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <colorchat>
#include <csx>
#include <zp_level_system>
#include <zombieplague>
#include <xs>
public plugin_init()
{
register_plugin("My Menu", "2.0", "Me");
register_clcmd("weapon", "menu_buy1", _, "Select team");
register_clcmd("weapon", "menu_buy1", _, "Select team");
register_concmd("weapon", "menu_buy1", _, "Select team");
}
public ShowMenu(id)
{
new menu = menu_create("\yWeapon Normal", "Csw4");
menu_additem(menu, "\wWeapon \r|| \yM4A1 \r||", "", 0); // case 0
menu_additem(menu, "\wWeapon \r|| \yAk47 \r||", "", 0); // case 1
menu_additem(menu, "\wWeapon \r|| \yM3 \r||", "", 0); // case 1
menu_additem(menu, "\wWeapon \r|| \yXM1014 \r||", "", 0); // case 1
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public Csw4(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item)
{
case 0:
{
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_m4a1")
menu_buy2(id)
}
case 1:
{
fm_give_item(id, "weapon_ak47")
fm_give_item(id, "weapon_ak47")
menu_buy2(id)
}
case 2:
{
fm_give_item(id, "weapon_m3")
fm_give_item(id, "weapon_m3")
menu_buy2(id)
}
case 3:
{
fm_give_item(id, "weapon_xm1014")
fm_give_item(id, "weapon_xm1014")
menu_buy2(id)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
stock fm_give_item(id, const item[])
{
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
if (!pev_valid(ent)) return;
static Float:originF[3]
pev(id, pev_origin, originF)
set_pev(ent, pev_origin, originF)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
static save
save = pev(ent, pev_solid)
dllfunc(DLLFunc_Touch, ent, id)
if (pev(ent, pev_solid) != save)
return;
engfunc(EngFunc_RemoveEntity, ent)
}
public menu_buy1(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;
else if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id))
{
ChatColor(id, "!g[CSo]!y Available only !tPlayer!y.")
return PLUGIN_HANDLED;
}
ShowMenu(id)
}
public menu_buy2(id)
{
new menu = menu_create("\yWeapon Pistor", "Csw5");
menu_additem(menu, "\wUSP", "", 0); // case 0
menu_additem(menu, "\wGlock 18C", "", 0); // case 1
menu_additem(menu, "\wDeagle", "", 0); // case 1
menu_additem(menu, "\wDual Ifniity", "", 0); // case 1
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public Csw5(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item)
{
case 0:
{
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
fm_give_item(id, "weapon_smokegrenade")
}
case 1:
{
fm_give_item(id, "weapon_glock18")
fm_give_item(id, "weapon_glock18")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
fm_give_item(id, "weapon_smokegrenade")
}
case 2:
{
fm_give_item(id, "weapon_deagle")
fm_give_item(id, "weapon_deagle")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
fm_give_item(id, "weapon_smokegrenade")
}
case 3:
{
fm_give_item(id, "weapon_elite")
fm_give_item(id, "weapon_elite")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
fm_give_item(id, "weapon_smokegrenade")
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
i will attach the .inc files if needed
|
|