Raised This Month: $32 Target: $400
 8% 

Ham_Item_GetItemInfo broken (Linux)


Post New Thread Reply   
 
Thread Tools Display Modes
PartialCloning
Senior Member
Join Date: Dec 2015
Old 07-26-2017 , 12:02   Re: Ham_Item_GetItemInfo broken (Linux)
Reply With Quote #11

Yes, it works on windows for me too but not on linux.

If you hook the WeaponList message (get_user_msgid requires map change), it's not called for any weapon that "Ham_Item_GetItemInfo" is hooked for.

https://github.com/s1lentq/ReGameDLL_CS/blob/1eb385602a538d08575ef54245c5ef9ebf39de1d/regamedll/dlls/player.cpp#L261

Code:
#include <amxmodx> #include <fun> #include <hamsandwich> public plugin_precache() {     RegisterHam(Ham_Item_GetItemInfo, "weapon_scout", "CBasePlayerItem_GetItemInfo", .Post = true);     RegisterHam(Ham_Item_GetItemInfo, "weapon_m4a1", "CBasePlayerItem_GetItemInfo", .Post = true);     RegisterHam(Ham_Item_GetItemInfo, "weapon_ak47", "CBasePlayerItem_GetItemInfo", .Post = true);     new WeaponList = get_user_msgid("WeaponList");     if(WeaponList)         register_message(WeaponList, "WriteSigonMessages"); } public CBasePlayerItem_GetItemInfo(pItem, iItemInfo) {     return HAM_IGNORED; } public WriteSigonMessages() {     new szWeapon[20];     get_msg_arg_string(1, szWeapon, charsmax(szWeapon));     server_print("szWeapon: %s. %d %d %d %d %d %d %d %d", szWeapon, get_msg_arg_int(2), get_msg_arg_int(3), get_msg_arg_int(4), get_msg_arg_int(5), get_msg_arg_int(6), get_msg_arg_int(7),get_msg_arg_int(8), get_msg_arg_int(9)); } public plugin_init() {     RegisterHam(Ham_Spawn, "player", "OnSpawnPost",  .Post = true); } public OnSpawnPost(id) {     if(is_user_alive(id))     {         give_item(id, "weapon_ak47");         give_item(id, "weapon_m4a1");         give_item(id, "weapon_usp");     } }
PartialCloning is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-26-2017 , 12:33   Re: Ham_Item_GetItemInfo broken (Linux)
Reply With Quote #12

I get it, the handler is incorrect. The header for this function is "int GetItemInfo(ItemInfo *p)". It returns an integer.

For some reason, GetItemInfo in Ham module is associated to "Void_ItemInfo" but it should be "Int_ItemInfo".
__________________
Arkshine is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 07-26-2017 , 14:18   Re: Ham_Item_GetItemInfo broken (Linux)
Reply With Quote #13

Great!! I saw your new pull request on the github page. Is there a place to download an actual build before it gets pushed without having to manually compile it?

@PRoSToTeM@ https://github.com/alliedmodders/amxmodx/pull/449
PartialCloning is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-26-2017 , 14:38   Re: Ham_Item_GetItemInfo broken (Linux)
Reply With Quote #14

It's merged now.
__________________
Arkshine is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 07-26-2017 , 16:06   Re: Ham_Item_GetItemInfo broken (Linux)
Reply With Quote #15

Thank you! (and Klippy for reviewing it). Tested and works.
PartialCloning is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode