Raised This Month: $51 Target: $400
 12% 

Solved [ H3LP ] Weapon Drop/Strip by slot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-23-2017 , 15:58   [ H3LP ] Weapon Drop/Strip by slot
Reply With Quote #1

I made some modifications to the ConnorMCLeod (ham_strip_weapon) code, but the code is not functioning properly. Any ideas?

Code:
stock const m_rgpPlayerItems_CBasePlayer[6] = { 367, 368, ... } new const SLOTID[] = {     -1,  // CSW_NONE     2,    // CSW_P228     -1,  // CSW_GLOCK     1,    // CSW_SCOUT     4,    // CSW_HEGRENADE     1,    // CSW_XM1014     5,    // CSW_C4     1,    // CSW_MAC10     1,    // CSW_AUG     4,    // CSW_SMOKEGRENADE     2,    // CSW_ELITE     2,    // CSW_FIVESEVEN     1,    // CSW_UMP45     1,    // CSW_SG550     1,    // CSW_GALIL / CSW_GALI     1,    // CSW_FAMAS     2,    // CSW_USP     2,    // CSW_GLOCK18     1,    // CSW_AWP     1,    // CSW_MP5NAVY     1,    // CSW_M249     1,    // CSW_M3     1,    // CSW_M4A1     1,    // CSW_TMP     1,    // CSW_G3SG1     4,    // CSW_FLASHBANG     2,    // CSW_DEAGLE     1,    // CSW_SG552     1,    // CSW_AK47     3,    // CSW_KNIFE     1      // CSW_P90 } strip_items_by_slot(const id, const slot) {     new weapon, current_weapon, weapon_id     current_weapon = cs_get_user_weapon_entity(id)         while ((weapon = get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[slot])) > 0)     {         if (current_weapon == weapon)             ExecuteHamB(Ham_Weapon_RetireWeapon, weapon)         if (ExecuteHamB(Ham_RemovePlayerItem, id, weapon))         {             user_has_weapon(id, weapon_id, 0)             ExecuteHamB(Ham_Item_Kill, weapon)         }     }     return 1; } drop_items_by_slot(const id, const slot) {     new weapon, weapon_id, weapon_name[32]     while ((weapon = get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[slot])) > 0)     {         weapon_id = cs_get_weapon_id(weapon)         get_weaponname(weapon_id, weapon_name, charsmax(weapon_name))         engclient_cmd(id, "drop", weapon_name)         user_has_weapon(id, weapon_id, 0)     }     return 1; }
__________________









Last edited by CrazY.; 09-25-2017 at 21:25.
CrazY. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-24-2017 , 00:47   Re: [ H3LP ] Weapon Drop/Strip by slot
Reply With Quote #2

weapon_id variable doesnt have any value in strip_items_by_slot function
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-25-2017 , 20:36   Re: [ H3LP ] Weapon Drop/Strip by slot
Reply With Quote #3

I did some tests. I need to add a delay of 0.1s to this code works properly, but I don't need this code anymore, ReAPI have a native that works the same way.
__________________









Last edited by CrazY.; 09-25-2017 at 20:37.
CrazY. 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 14:31.


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