Raised This Month: $ Target: $400
 0% 

[Req] Knife Only + HE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-14-2015 , 15:10   [Req] Knife Only + HE
Reply With Quote #1

hi
i need a plugin that gives you knife + HE every spawn and remove the other weapons

thanks.
BeSt2013 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-14-2015 , 15:35   Re: [Req] Knife Only + HE
Reply With Quote #2

Fastly done, but should work:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#include <fun>

public plugin_init()
{
    new 
Entity find_ent_by_class(-1"game_player_equip")
    if(
pev_valid(Entity))
    {
        
remove_entity(Entity)
    }
    
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn"true)
}

public 
CBasePlayer_Spawn(id)
{
    if(
is_user_alive(id))
    {
        if(!
user_has_weapon(idCSW_KNIFE))
        {
            
give_item(id"weapon_knife")
        }
        if(!
user_has_weapon(idCSW_HEGRENADE))
        {
            
give_item(id"weapon_hegrenade")
        }
    }

__________________
HamletEagle is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-14-2015 , 16:57   Re: [Req] Knife Only + HE
Reply With Quote #3

ty for the plugin
but when i respawn in the map
it's gives me weapon like usp and i don't want that i want the plugin to remove all weapons you have
and gives you only knife + he every spawn
BeSt2013 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-14-2015 , 16:57   Re: [Req] Knife Only + HE
Reply With Quote #4

@Hamlet
That will not work.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>

public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn"true)
}

public 
CBasePlayer_Spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weaponsid )
        
give_item(id"weapon_knife")
        
        if(!
user_has_weapon(idCSW_HEGRENADE))
        {
            
give_item(id"weapon_hegrenade")
        }
    }

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-14-2015 , 17:21   Re: [Req] Knife Only + HE
Reply With Quote #5

ty very much it's works

Last edited by BeSt2013; 08-14-2015 at 17:21.
BeSt2013 is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-14-2015 , 18:04   Re: [Req] Knife Only + HE
Reply With Quote #6

it's removing weapons but not the C4
can you edit it please
BeSt2013 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-14-2015 , 18:56   Re: [Req] Knife Only + HE
Reply With Quote #7

Here you go.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fun>

public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn"true)
    
    if ( 
find_ent_by_class( -1"func_bomb_target" ) || find_ent_by_class( -1"info_bomb_target" ) )
    {
        new 
target = -1classname[ ] = "func_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
        
classname "info_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
    }
}

public 
CBasePlayer_Spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weaponsid )
        
        
give_item(id"weapon_knife")
        
        if(!
user_has_weapon(idCSW_HEGRENADE))
        {
            
give_item(id"weapon_hegrenade")
        }
    }

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 08-14-2015 , 20:20   Re: [Req] Knife Only + HE
Reply With Quote #8

Quote:
Originally Posted by wickedd View Post
Here you go.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fun>

public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn"true)
    
    if ( 
find_ent_by_class( -1"func_bomb_target" ) || find_ent_by_class( -1"info_bomb_target" ) )
    {
        new 
target = -1classname[ ] = "func_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
        
classname "info_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
    }
}

public 
CBasePlayer_Spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weaponsid )
        
        
give_item(id"weapon_knife")
        
        if(!
user_has_weapon(idCSW_HEGRENADE))
        {
            
give_item(id"weapon_hegrenade")
        }
    }

Why are you repeating
Code:
while ( ( target = find_ent_by_class( target, classname ) ) )         remove_entity( target )

?
Freezo Begin is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 08-15-2015 , 00:17   Re: [Req] Knife Only + HE
Reply With Quote #9

Quote:
Originally Posted by wickedd View Post
Here you go.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fun>

public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn"true)
    
    if ( 
find_ent_by_class( -1"func_bomb_target" ) || find_ent_by_class( -1"info_bomb_target" ) )
    {
        new 
target = -1classname[ ] = "func_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
        
classname "info_bomb_target"
        
while ( ( target find_ent_by_classtargetclassname ) ) )
        
remove_entitytarget )
    }
}

public 
CBasePlayer_Spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weaponsid )
        
        
give_item(id"weapon_knife")
        
        if(!
user_has_weapon(idCSW_HEGRENADE))
        {
            
give_item(id"weapon_hegrenade")
        }
    }

thx but not working
BeSt2013 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-15-2015 , 04:52   Re: [Req] Knife Only + HE
Reply With Quote #10

Try my custom spawn weapons plugin. Check my plugins link in signature. You can select any weapon for player to spawn with including different weapons for each team.
__________________
Blizzard_87 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 03:57.


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