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

[Req] No Pickup Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-15-2015 , 00:21   [Req] No Pickup Weapons
Reply With Quote #1

hi
i know there is a plugins for no pickup weapons
but i need a plugin that allows you to pickup HE Grenade only
and the other weapons you can't pickup it
BeSt2013 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-15-2015 , 11:28   Re: [Req] No Pickup Weapons
Reply With Quote #2

PHP Code:
#include <amxmodx> 
#include <engine> 
#include <cstrike> 
#include <fakemeta>

public plugin_init() 

    
register_touch("armoury_entity""player""CArmoury_Touch"
    
register_touch("weaponbox""player""CWeaponBox_Touch"


public 
CArmoury_Touch(Entityid

    if(
pev_valid(Entity))
    {
        if(
cs_get_armoury_type(Entity) != CSW_HEGRENADE)
        {
            return 
PLUGIN_HANDLED
        
}
    }
   
    return 
PLUGIN_CONTINUE


public 
CWeaponBox_Touch(Entityid

    if(
pev_valid(Entity))
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

__________________
HamletEagle is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-21-2015 , 15:37   Re: [Req] No Pickup Weapons
Reply With Quote #3

thanks very much it's working
BeSt2013 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-21-2015 , 18:47   Re: [Req] No Pickup Weapons
Reply With Quote #4

Tidied up a little
PHP Code:
public CArmoury_TouchEntity id 

    return ( 
pev_validEntity ) && ( cs_get_armoury_typeEntity ) != CSW_HEGRENADE ) ) ? PLUGIN_HANDLED PLUGIN_CONTINUE;


public 
CWeaponBox_TouchEntity id 
{
    return 
pev_validEntity ) ? PLUGIN_HANDLED PLUGIN_CONTINUE;

__________________
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-22-2015 , 05:00   Re: [Req] No Pickup Weapons
Reply With Quote #5

IMO, this is not readable. Using if is fine and make the code looks better, more clear. Anyway, everyone has his style.
__________________

Last edited by HamletEagle; 08-22-2015 at 05:01.
HamletEagle 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 17:40.


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