Raised This Month: $ Target: $400
 0% 

engclient_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-30-2009 , 06:22   engclient_cmd
Reply With Quote #1

PHP Code:
public plugin_init( )
{
    
register_event("CurWeapon""check_knife""be""1=1");
}

public 
check_knifeid )
{
    if ( 
is_user_aliveid ) )
    {
        if ( 
get_user_weaponid ) != CSW_KNIFE && get_user_weaponid ) != CSW_C4 )
        {
            
engclient_cmd(id"weapon_knife");
        }
        else if ( 
get_user_weaponid ) != CSW_KNIFE && get_user_weaponid ) == CSW_C4 )
        {
        }
    }

Can anybody give more effective code?
Debesėlis is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 12-30-2009 , 07:28   Re: engclient_cmd
Reply With Quote #2

try this:
PHP Code:
#include <amxmodx>

public plugin_init( )
{
    
register_event("CurWeapon""check_knife""be""1=1");
}

public 
check_knifeid )
{
    if ( 
is_user_aliveid ) )
    {
        if ( 
user_has_weaponidCSW_C4 ) )
        {
            return
        }
        else if ( !
user_has_weaponidCSW_KNIFE ) )
        {
            
engclient_cmdid"weapon_knife" );
        }
    }

dFF is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-30-2009 , 07:40   Re: engclient_cmd
Reply With Quote #3

other weapons block to use?

I need that player can use only the knife and if Terrorist have C4 can use knife and C4... Other weapons must be blocked...

Last edited by Debesėlis; 12-30-2009 at 07:57.
Debesėlis is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-30-2009 , 08:09   Re: engclient_cmd
Reply With Quote #4

PHP Code:
enum _:CurWeapon_Structure
{
    
CurWeapon_IsActive 1,
    
CurWeapon_WeaponID,
    
CurWeapon_ClipAmmo,
}

public 
plugin_init( )
{
    
register_event("CurWeapon""Event_CurWeapon_NotKnife""be""1=1""2!=29"// CSW_KNIFE == 29
}


// http://wiki.amxmodx.org/Half-Life_1_Game_Events#CurWeapon

public Event_CurWeapon_NotKnifeid )
{
    
// new iCurWeapon = read_data( CurWeapon_WeaponID ) // use this if you need the value more than 1 time
    
if( read_dataCurWeapon_WeaponID ) != CSW_C4 )
    {
        
engclient_cmd(id"weapon_knife")
    }
/*    else
    {
        
    }*/

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-30-2009 , 08:32   Re: engclient_cmd
Reply With Quote #5

Ok thanks works fine.

FIX IT , don't need...
PHP Code:
CurWeapon_ClipAmmo
Debesėlis is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-30-2009 , 08:33   Re: engclient_cmd
Reply With Quote #6

Ok thanks works fine.

FIX IT , don't need...
PHP Code:
CurWeapon_ClipAmmo
Debesėlis is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-30-2009 , 08:37   Re: engclient_cmd
Reply With Quote #7

Also, flag "e" ("be") already checks for alive player, forgot to tell you.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-30-2009 , 08:43   Re: engclient_cmd
Reply With Quote #8

Ok thanks
Debesėlis is offline
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 04:15.


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