Raised This Month: $ Target: $400
 0% 

[HELP] No Weapon Buy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 02-03-2010 , 12:47   [HELP] No Weapon Buy
Reply With Quote #1

Hi there, could some1 say me how could i do, that noone can buy AWP, except the VIP players. Weapon Restriction Won't Work!

i need something like

PHP Code:
    if(get_user_flags(id) & ADMIN_LEVEL_H)
    {
        return 
PLUGIN_CONTINUE;
        } else {
            
//* RESTRICTION HERE (THIS IS WHAT I NEED) *\\
            
client_print(idprint_chat"Only VIP Can buy AWP");
        }
        return 
PLUGIN_CONTINUE;
    } 
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-03-2010 , 12:55   Re: [HELP] No Weapon Buy
Reply With Quote #2

Code:
#include < amxmodx > #include < fakemeta > #include < hamsandwich > const m_iId = 43; public plugin_init( ) {     RegisterHam( Ham_AddPlayerItem, "player", "FwdAddPlayerItem" ); } public FwdAddPlayerItem( iPlayer, iEntity ) {     return ( is_user_alive( iPlayer )         && !( get_user_flags( iPlayer ) & ADMIN_LEVEL_H )         && get_pdata_int( iEntity, m_iId ) == CSW_AWP ) ?             HAM_SUPERCEDE : HAM_IGNORED; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-03-2010 , 12:57   Re: [HELP] No Weapon Buy
Reply With Quote #3

Exolent code gonna take player's money.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 02-03-2010 , 12:58   Re: [HELP] No Weapon Buy
Reply With Quote #4

but i dont want that

and it won't work for me have you tested it?

Last edited by reinert; 02-03-2010 at 13:03.
reinert is offline
Old 02-03-2010, 14:16
reinert
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-03-2010 , 18:13   Re: [HELP] No Weapon Buy
Reply With Quote #5

ill post the code when I get home from work
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-03-2010 , 23:26   Re: [HELP] No Weapon Buy
Reply With Quote #6

If you are planning on adding restrictions for other weapons let me know.

Edit: Updated code using cstrike module instead of fakemeta
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define FLAG_ALLOW        ADMIN_LEVEL_H

public plugin_init() 
{
    
register_plugin"Block AWP Purchase" "0.1" "bugsy" );
    
    
RegisterHamHam_AddPlayerItem ,"player" ,"fw_AddPlayerItem" );
}

public 
fw_AddPlayerItemiPlayer iItem )
{
    if ( 
get_user_flagsiPlayer ) & FLAG_ALLOW )
        return 
HAM_IGNORED;

    if ( 
cs_get_weapon_idiItem ) == CSW_AWP )
    {    
        
set_task0.15 "ReimburseMoney" iPlayer );
        
client_printiPlayer print_chat "* You are restricted from using AWP!" );
        
SetHamReturnInteger); 
        
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
ReimburseMoneyid )
{
    
cs_set_user_moneyid clamp( ( cs_get_user_moneyid ) + 4750 ) , 4750 16000 ) , );

__________________

Last edited by Bugsy; 02-05-2010 at 09:22.
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-04-2010 , 00:47   Re: [HELP] No Weapon Buy
Reply With Quote #7

Won't this give players $4750 when they try to pick up a weapon from the ground ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-04-2010 , 08:08   Re: [HELP] No Weapon Buy
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Won't this give players $4750 when they try to pick up a weapon from the ground ?
This is in addition to his existing code which already prevents awp pickup.
__________________
Bugsy is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 02-04-2010 , 08:55   Re: [HELP] No Weapon Buy
Reply With Quote #9

won't work for me, can you test it? it works?
reinert is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-04-2010 , 09:10   Re: [HELP] No Weapon Buy
Reply With Quote #10

And what's the reason for:
PHP Code:
write_byte( !!flash ); 
????
Seta00 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 07:24.


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