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

Solved Healthshot - slot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 12-15-2018 , 16:06   Healthshot - slot
Reply With Quote #1

Hello,
I can not removed Healthshot, because after last update this item has new slot.
Someone know which is the slot?

Last edited by Qes; 01-27-2019 at 09:53.
Qes is offline
root88
Senior Member
Join Date: May 2016
Old 12-15-2018 , 16:27   Re: Healthshot - slot
Reply With Quote #2

Removing it by slot currently doesn't work. Check this out. You can easily adjust code part near RemovePlayerItem to remove healthshot.
__________________
root88 is offline
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 12-15-2018 , 16:43   Re: Healthshot - slot
Reply With Quote #3

Thanks, it works
// Dziękuję bardzo
Qes is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-15-2018 , 18:03   Re: Healthshot - slot
Reply With Quote #4

Quote:
Originally Posted by root88 View Post
Removing it by slot currently doesn't work. Check this out. You can easily adjust code part near RemovePlayerItem to remove healthshot.
Is there reason why need use "offsets" to look "m_hMyWeapons" ?

Isn't this more simple ?
PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);

}

public 
Action test(int clientint args)
{

    
char classname[35];
    
int m_hMyWeapons_size GetEntPropArraySize(clientProp_Send"m_hMyWeapons"); // array size
    
int item;

    for(
int index 0index m_hMyWeapons_sizeindex++)
    {
        
item GetEntPropEnt(clientProp_Send"m_hMyWeapons"index);

        if(
item != -1)
        {
            
GetEntityClassname(itemclassnamesizeof(classname));
            
PrintToServer("%N has (%i)%s"clientitemclassname);
        }
    }

    return 
Plugin_Handled;

__________________
Do not Private Message @me

Last edited by Bacardi; 12-15-2018 at 19:21. Reason: Dam weapon int
Bacardi is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-15-2018 , 19:19   Re: Healthshot - slot
Reply With Quote #5

So now this remove all the weapons except Healthshot:
PHP Code:
stock void StripAllWeapons(int client)
{
    
int wepIdx;
    for (
int i5i++)
    {
        while ((
wepIdx GetPlayerWeaponSlot(clienti)) != -1)
        {
            
RemovePlayerItem(clientwepIdx);
            
AcceptEntityInput(wepIdx"Kill");
        }
    }

And now to remove all the weapons should be like this:
PHP Code:
stock void StripAllWeapons(int client)
{
    
int m_hMyWeapons_size GetEntPropArraySize(clientProp_Send"m_hMyWeapons"); // array size 
    
int item

    for(
int index 0index m_hMyWeapons_sizeindex++) 
    { 
        
item GetEntPropEnt(clientProp_Send"m_hMyWeapons"index); 

        if(
item != -1
        { 
            
RemovePlayerItem(clientitem);
            
AcceptEntityInput(item"Kill");
        } 
    } 

Correct? time to update some plugins
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 12-15-2018 at 19:28.
Franc1sco is offline
Send a message via MSN to Franc1sco
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-15-2018 , 19:22   Re: Healthshot - slot
Reply With Quote #6

...I changed variable name later before posting, shuold be now item, not weapon
sry

*edit
I wanted to know, why we go back "offsets" like... 5 years ago or somewhere that

Last edited by Bacardi; 12-15-2018 at 19:25.
Bacardi is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-15-2018 , 19:25   Re: Healthshot - slot
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
...I changed variable name later before posting, shuold be now item, not weapon
sry
Ohh, I had not realized. I edited my post too.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Reply


Thread Tools
Display Modes

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:53.


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