Raised This Month: $ Target: $400
 0% 

Help with Flag's within this script!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 04-02-2009 , 17:30   Help with Flag's within this script!
Reply With Quote #1

Hey guys when I try to change the FLAG used to give the admin this ability it doesnt register all the admins get the boost regardless of if they have the flag or not.

This was done by a member of the community requested here,
http://forums.alliedmods.net/showthread.php?t=88521

Code:
    #include <amxmodx>
    #include <fakemeta>
    #include <hamsandwich>
    
    const MAX_CLIENTS = 32;
    new bool:gCanSpeed[ MAX_CLIENTS + 1 ];
    
    new pCvarKnifeSpeed;
    new pCvarKnifeFlags;
    
    public plugin_init()
    {
        register_plugin( "Knife Speed", "1.0.0", "Arkshine" );
        
        pCvarKnifeSpeed = register_cvar( "knife_speed", "400" );
        pCvarKnifeFlags = register_cvar( "knife_flags", "a" );
        
        RegisterHam( Ham_CS_Item_GetMaxSpeed, "weapon_knife", "Event_ChangeKnifeSpeed" );
    }

    public client_putinserver( Client )
    {
        gCanSpeed[ Client ] = !!( get_user_flags( Client ) & GetFlagsFromCvar() );
    }
    
    public Event_ChangeKnifeSpeed ( const Entity )
    {
        if ( gCanSpeed[ pev( Entity, pev_owner ) ] )
        {
            SetHamReturnFloat( get_pcvar_float( pCvarKnifeSpeed ) );
            return HAM_SUPERCEDE;
        } 
        
        return HAM_IGNORED;
    }
    
    GetFlagsFromCvar ()
    {
        static Flags[ 26 ];
        get_pcvar_string( pCvarKnifeFlags, Flags, charsmax( Flags ) );

        return read_flags( Flags );
    }
Thanks guys
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
 



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 02:20.


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