Slot max weapons

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
29
Реакции
4
Помог
1 раз(а)
Ошибка
None.
ОС
Linux
Amx Mod X
AMX Mod X 1.8.3-dev+5154 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Mar 11 2018 07:25:29
Built from: https://github.com/alliedmodders/amxmodx/commit/2559fcf0
Build ID: 5154:2559fcf0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 09:10:05 Jul 7 2017 (7561)
ReGamedll
ReGameDLL version: 5.7.0.312-dev
Build date: 07:53:34 May 31 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/26db32e
Версия Metamod
Metamod v1.21-am  2013-03-15 (5:13)
by Will Day <[email protected]>
http://www.metamod.org/
compiled: Mar 15 2013, 15:20:21 (msc optimized)
Список метамодулей
[ 1] AMX Mod X        RUN   -    amxmodx_mm_i386.  v1.8.3-d  ini   Start ANY  
[ 2] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-d pl1 ANY ANY
[ 3] CSX RUN - csx_amxx_i386.so v1.8.3-d pl1 ANY ANY
[ 4] Engine RUN - engine_amxx_i386 v1.8.3-d pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-d pl1 ANY ANY
[ 6] ReAPI RUN - reapi_amxx_i386. v5.6.0.1 pl1 ANY Never
Список плагинов
[  1] Admin Base              1.8.3-dev+  AMXX Dev Team     admin.amxx       running  
[ 2] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.8.3-dev+ AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.8.3-dev+ AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.8.3-dev+ AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.8.3-dev+ AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.3-dev+ AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.8.3-dev+ AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.8.3-dev+ AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.8.3-dev+ AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.8.3-dev+ AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.8.3-dev+ AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.8.3-dev+ AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.8.3-dev+ AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.8.3-dev+ AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.8.3-dev+ AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.8.3-dev+ AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.8.3-dev+ AMXX Dev Team statsx.amxx running
[ 22] AddPlayerItem 1.0 Crazy test.amxx running
Автор плагина
Crazy
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <reapi>

const WEAPON_CUSTOM = 100;

#define isCustomWeapon(%1) (get_entvar(%1, var_impulse) == WEAPON_CUSTOM)

new const g_pszNameAk47[] = "weapon_ak47";

public plugin_init()
{
register_plugin("AddPlayerItem", "1.0", "Crazy");

register_clcmd("say custom", "cmdCustom");

RegisterHookChain(RG_CBasePlayer_AddPlayerItem, "CBasePlayer_AddPlayerItem");
}

public cmdCustom(this)
{
new pevWeapon = rg_give_item(this, g_pszNameAk47, GT_REPLACE);

set_entvar(pevWeapon, var_impulse, WEAPON_CUSTOM);

rg_set_user_bpammo(this, WEAPON_AK47, rg_get_weapon_info(WEAPON_AK47, WI_MAX_ROUNDS));
}

public CBasePlayer_AddPlayerItem(this, pevItem)
{
if (!isCustomWeapon(pevItem))
return HC_CONTINUE;

new pevInsert = get_member(this, m_rgpPlayerItems, rg_get_iteminfo(pevItem, ItemInfo_iSlot));

while (pevInsert)
{
if (FClassnameIs(pevInsert, g_pszNameAk47))
return HC_CONTINUE;

pevInsert = get_member(pevInsert, m_pNext);
}

SetHookChainReturn(ATYPE_INTEGER, true);
return HC_SUPERCEDE;
}
Hello, I'm trying to allow the player to pick up the dropped weapon even if he already have weapons in the same slot. The code I did above don't worked and probably I did something wrong.
 
В этой теме было размещено решение! Перейти к решению.

hajimura

Е777КХ05
Сообщения
290
Реакции
228
Помог
6 раз(а)
Код:
-new pevWeapon = rg_give_item(this, g_pszNameAk47, GT_REPLACE);
+new pevWeapon = rg_give_item(this, g_pszNameAk47, GT_APPEND);
?
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
Sorry if I didn't was specific, but I mean in CWeaponBox::Touch.
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
CrazY, pay attention to this code: https://dev-cs.ru/resources/201/field?field=source
26 Июл 2018
and
Код:
public cmdCustom(this)
{
-    new pevWeapon = rg_give_item(this, g_pszNameAk47, GT_REPLACE);
-    set_entvar(pevWeapon, var_impulse, WEAPON_CUSTOM);
+    rg_give_custom_item(this, g_pszNameAk47, GT_DROP_AND_REPLACE, WEAPON_CUSTOM);
    
    rg_set_user_bpammo(this, WEAPON_AK47, rg_get_weapon_info(WEAPON_AK47, WI_MAX_ROUNDS));
}
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу