Raised This Month: $ Target: $400
 0% 

Need HELP with AWP pick up Restrict plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 01-30-2008 , 08:57   Re: Need HELP with AWP pick up Restrict plugin
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define ADMIN_LEVEL ADMIN_LEVEL_H
 
new cv_awpforadmins
 
public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR");
    
register_event("CurWeapon""Event_CurWeapon""be")
    
cv_awpforadmins register_cvar("amx_awp_for_admins_only""1")
}
public 
Event_CurWeapon(id)

      new 
trash
      
new weapon get_user_weapon(id,trash,trash);
 
      new 
allowed
      
allowed get_pcvar_num(cv_awpforadmins);
 
      if(
allowed == && access(idADMIN_LEVEL))
      {
          return 
PLUGIN_CONTINUE;
      }
      else if (
weapon == CSW_AWP)
      {
          
client_cmd(id"drop");
      }
      return 
PLUGIN_HANDLED;
}
public 
client_command(id
{
      
//works only if awp is bought trought console :<
      
new arg[13];
      
read_argv(0arg 12)
 
      if (
equal("awp"arg )) 
      {
          
client_print(idprint_chat"[AMXX] You're not allowed to buy that weapon.");
          return 
PLUGIN_HANDLED;
      }
      return 
PLUGIN_CONTINUE;

Only works with pickup and console buy. Use restrict menu.
[X]-RayCat 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 01:23.


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