Skip to content

Commit

Permalink
Fixing Small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PerfectScrash committed Mar 6, 2022
1 parent a9e941d commit 947946c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,6 @@
- Added Native: zp_get_default_knockback(id)
- Added Native: zp_get_user_default_maxspeed(id)
- Added Hud Cvars
- Fixing 06/03
- Fixed bug when you choose gun locked by forward in weapons menu and opens a secondary menu
- Fixed bug when load/save custom primary/secondary weapons with same name
20 changes: 13 additions & 7 deletions addons/amxmodx/scripting/zombie_plague_special_45.sma
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@
- Added Native: zp_get_user_default_maxspeed(id)
- Added Hud Cvars

-- Fixing 06/03
- Fixed bug when you choose gun locked by forward in weapons menu and opens a secondary menu
- Fixed bug when load/save custom primary/secondary weapons with same name


============================================================================================================================*/

Expand Down Expand Up @@ -4539,9 +4543,10 @@ public menu_buy(id, key) { // Buy Menu
}
if(WPN_TYPE == 0) {
WPN_AUTO_PRI = WPN_SELECTION // Store selected weapon id
buy_weapon(id, WPN_AUTO_PRI, 0) // Buy primary weapon
WPN_STARTID = 0
show_menu_buy(id, 1) // Show pistols menu
if(buy_weapon(id, WPN_AUTO_PRI, 0)) { // Buy primary weapon
WPN_STARTID = 0
show_menu_buy(id, 1) // Show pistols menu
}
}
else {
WPN_AUTO_SEC = WPN_SELECTION // Store selected weapon id
Expand All @@ -4562,7 +4567,7 @@ buy_weapon(id, selection, sec) { // Buy Primary/Secondary Weapon
if(g_fwDummyResult >= ZP_PLUGIN_HANDLED) {
WPN_AUTO_ON = 0
show_menu_buy(id, sec)
return;
return 0;
}
if(!sec) {
drop_weapons(id, 1) // Drop previous weapons
Expand All @@ -4588,6 +4593,7 @@ buy_weapon(id, selection, sec) { // Buy Primary/Secondary Weapon
}
g_canbuy[id] = sec ? 0 : 1 // Weapons bought
ExecuteForward(g_forwards[WEAPON_SELECTED_POST], g_fwDummyResult, id, sec, selection);
return 1;
}
public menu_extras(id, menuid, item) { // Extra Items Menu
if(!is_user_connected(id)) { // Player disconnected?
Expand Down Expand Up @@ -11482,9 +11488,9 @@ public native_register_weapon(plugin_id, num_params) { // Native: zp_register_we
}
}

static section[32]
copy(section, charsmax(section), name)
ArrayPushString(g_wpn_realname[secondary], section)
static section[64]
formatex(section, charsmax(section), "%s:%s", secondary ? "Sec" : "Pri", name)
ArrayPushString(g_wpn_realname[secondary], name)

if(!amx_load_setting_string(ZP_WEAPONS_FILE, section, "NAME", name, charsmax(name)))
amx_save_setting_string(ZP_WEAPONS_FILE, section, "NAME", name)
Expand Down

0 comments on commit 947946c

Please sign in to comment.