Raised This Month: $114 Target: $400
 28% 

Kevlar Pickup Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Hawk552 (427)
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-20-2009 , 14:16   Kevlar Pickup Fix
Reply With Quote #1

Kevlar Pickup Fix
By xPaw

.: Description :.
For example, some plugin gave you kevlar + helmet, and you walk on kevlar on ground, you will pickup it, but no effect, so you can walk on all, and they will disappear, unfair for other players ye ? Or for example you have 50 AP, you can walk on armor and it will give you 100
Attached Files
File Type: sma Get Plugin or Get Source (KevlarPickupFix.sma - 2692 views - 1.0 KB)
__________________

Last edited by xPaw; 05-19-2012 at 13:51.
xPaw is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-20-2009 , 14:17   Re: Kevlar Pickup Fix
Reply With Quote #2

I have seen this already...

EDIT: Yeah, you released it already in Suggestions


Way to go BugFixer
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-20-2009 , 16:09   Re: Kevlar Pickup Fix
Reply With Quote #3

There is no need to use entity_get_string( iEntity, EV_SZ_model,..) since you need to use cs_get_armoury_type after.

I don't think kevlars disappear in such situations, only players are not able to pick them up.
__________________
- tired and retired -
ConnorMcLeod is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-20-2009 , 16:18   Re: Kevlar Pickup Fix
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
There is no need to use entity_get_string( iEntity, EV_SZ_model,..) since you need to use cs_get_armoury_type after.

I don't think kevlars disappear in such situations, only players are not able to pick them up.
Yes it did, i have a plugin wich gives item_assaultsuit, and on ground was kevlar, i walked on it, and pickuped all of them oO
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-20-2009 , 16:38   Re: Kevlar Pickup Fix
Reply With Quote #5

That plugin (the one that gives the item) doesn't seems to update player armortype pdata.
__________________
- tired and retired -
ConnorMcLeod is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-20-2009 , 16:59   Re: Kevlar Pickup Fix
Reply With Quote #6

give_item( id, "item_assaultsuit" );
__________________
xPaw is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 08-20-2009 , 18:09   Re: Kevlar Pickup Fix
Reply With Quote #7

item_assaultsuit is a buggy entity in cs.
KadiR is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-20-2009 , 21:33   Re: Kevlar Pickup Fix
Reply With Quote #8

Fuck, i hate you xPawn, i had this ideea too just a few days ago
__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-21-2009 , 01:41   Re: Kevlar Pickup Fix
Reply With Quote #9

You messed up the plugin. cs_get_armoury_type doesn't return CSW_ values but CSA_.
How i would code it :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

public plugin_init()
{
    
register_plugin("Kevlar pickup fix""1.0""xPaw")

    
register_touch("armoury_entity""player""FwdWeaponBoxTouch")
}

public 
FwdWeaponBoxTouch(iEntityid)
{
    if( 
is_user_alive(id) )
    {    
        static 
iType
        iType 
cs_get_armoury_type(iEntity) - 15

        
static const bitArmorType _:CS_ARMOR_KEVLAR|_:CS_ARMOR_VESTHELM
    
        
if( iType bitArmorType )
        {
            static 
CsArmorType:iArmorTypeiArmor
            iArmor 
cs_get_user_armor(idiArmorType)

            if( 
_:iArmorType iType || (iArmor 100 && iType == _:iArmorType) )
            {
                
cs_set_user_armor(id0CS_ARMOR_NONE)
            }
        }
    }


The bug with item_assaultsuit shoud be fixed in any plugin using it but setting the armotype offset, or by replacing give_item with cs_set_user_armor.
__________________
- tired and retired -
ConnorMcLeod is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-06-2009 , 15:18   Re: Kevlar Pickup Fix
Reply With Quote #10

This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Old 01-02-2010, 17:28
Julian de L. Lopes
This message has been deleted by Julian de L. Lopes.
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 17:40.


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