Raised This Month: $ Target: $400
 0% 

Undropable weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-27-2009 , 06:39   Undropable weapons
Reply With Quote #1

How do you make these weapons undropable?

PHP Code:
public rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        
fm_strip_user_weapons(id)

        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
give_item(id"weapon_knife")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_m4a1")
            
give_item(id"weapon_awp")
            
cs_set_user_defuse(id0)
        }

        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
give_item(id"weapon_knife")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_ak47")
            
give_item(id"weapon_awp")
            
cs_set_user_defuse(id1)
        }
    }

Debesėlis is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-27-2009 , 07:02   Re: Undropable weapons
Reply With Quote #2

PHP Code:
public plugin_init()
{
    
register_clcmd("drop""cmdBlock");
}
 
public 
cmdBlock()
    return 
PLUGIN_HANDLED_MAIN
Something like that, or do you just want to drop specific weapons?
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-27-2009 , 07:09   Re: Undropable weapons
Reply With Quote #3

Quote:
Originally Posted by Xellath View Post
PHP Code:
public plugin_init()
{
    
register_clcmd("drop""cmdBlock");
}
 
public 
cmdBlock()
    return 
PLUGIN_HANDLED_MAIN
Something like that, or do you just want to drop specific weapons?
I want the weapons given not to be dropped, but if the terrorists have the C4, they'd still be able to drop it.
by the way, the command fm_strip_user_weapons(id) removes all weapons, how do I make it not remove the C4 if a terrorist has it?
Debesėlis is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 05-27-2009 , 07:27   Re: Undropable weapons
Reply With Quote #4

use ham_strip_weapon.
http://forums.alliedmods.net/showthread.php?t=56377
zwfgdlc is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 05-27-2009 , 07:28   Re: Undropable weapons
Reply With Quote #5

Quote:
Originally Posted by Debesėlis View Post
I want the weapons given not to be dropped, but if the terrorists have the C4, they'd still be able to drop it.
You can't make some exact weapon undropable. But you can mark the item or som' and when hooking dropping do what you want.
Quote:
Originally Posted by Debesėlis View Post
by the way, the command fm_strip_user_weapons(id) removes all weapons, how do I make it not remove the C4 if a terrorist has it?
Use strip_user_weapons instead. How about checking if a terrorist has the bomb, then stripping weapons and giving the bomb again? Easier than removing all other weapons separately lol.
SnoW is offline
Send a message via MSN to SnoW
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-27-2009 , 07:59   Re: Undropable weapons
Reply With Quote #6

what should it look like? Something like this?

PHP Code:
public rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        
fm_strip_user_weapons(id)

        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            if(
get_user_weapon(id) == CSW_C4)
            {
            
give_item(id"weapon_c4")
            }

            
give_item(id"weapon_knife")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_m4a1")
            
give_item(id"weapon_awp")
            
cs_set_user_defuse(id0)
        }

        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
cs_set_user_defuse(id1)
            
give_item(id"weapon_knife")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_ak47")
            
give_item(id"weapon_awp")
        }
    }

Debesėlis is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-27-2009 , 08:49   Re: Undropable weapons
Reply With Quote #7

Code:
#include <amxmodx> #include <hamsandwich>   public plugin_init() {         RegisterHam(Ham_CS_Item_CanDrop, "weapon_deagle", "CanDropForward");         RegisterHam(Ham_CS_Item_CanDrop, "weapon_m4a1", "CanDropForward");         RegisterHam(Ham_CS_Item_CanDrop, "weapon_ak47", "CanDropForward");         RegisterHam(Ham_CS_Item_CanDrop, "weapon_awp", "CanDropForward"); }   public CanDropForward() {         SetHamReturnInteger(1);           return HAM_SUPERCEDE; }
__________________
hleV 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:06.


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