Raised This Month: $ Target: $400
 0% 

Block this weapon ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 07-03-2009 , 02:15   Block this weapon ?
Reply With Quote #1

How to block these weapon :
PHP Code:
new const g_weapon_ents[][] = 
{
    
"weapon_p228",
    
"weapon_mac10",
    
"weapon_aug",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_ump45",
    
"weapon_sg550",
    
"weapon_galil",
    
"weapon_famas",
    
"weapon_awp",
    
"weapon_m249",
    
"weapon_m4a1",
    
"weapon_tmp",
    
"weapon_g3sg1",
    
"weapon_deagle",
    
"weapon_sg552",
    
"weapon_ak47"

I has search about blocking weapon. but, it's block all weapons.

Thanks you.
Anggara_nothing is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 07-03-2009 , 05:54   Re: Block this weapon ?
Reply With Quote #2

PHP Code:
new szWeapon[24]
get_weaponname(idszWeapon23)

if (
equal(szWeapon"weapon_blah"))
    
server_cmd("kick #%d ^"Restricted weapon^""get_user_userid(id)) 
You can replace the kick with whatever punishment you want.

Last edited by Spunky; 07-03-2009 at 06:01.
Spunky is offline
Send a message via AIM to Spunky
zwfgdlc
Senior Member
Join Date: May 2006
Old 07-03-2009 , 08:14   Re: Block this weapon ?
Reply With Quote #3

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

#define PLUGIN_NAME    "block_weapon"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "zwfgdlc"

new const g_weapon_ents[][] = 
{
    
"weapon_p228",
    
"weapon_mac10",
    
"weapon_aug",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_ump45",
    
"weapon_sg550",
    
"weapon_galil",
    
"weapon_famas",
    
"weapon_awp",
    
"weapon_m249",
    
"weapon_m4a1",
    
"weapon_tmp",
    
"weapon_g3sg1",
    
"weapon_deagle",
    
"weapon_sg552",
    
"weapon_ak47"
}  

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    for(new 
i=0;i<sizeof(g_weapon_ents);i++)
    
RegisterHam(Ham_Item_AddToPlayer,g_weapon_ents[i],"fw_Item_AddToPlayer");        
}
public 
fw_Item_AddToPlayer(ent,id)
{
    return 
HAM_SUPERCEDE;

zwfgdlc is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 07-03-2009 , 12:44   Re: Block this weapon ?
Reply With Quote #4

Quote:
Originally Posted by zwfgdlc View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN_NAME    "block_weapon"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "zwfgdlc"

new const g_weapon_ents[][] = 
{
    
"weapon_p228",
    
"weapon_mac10",
    
"weapon_aug",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_ump45",
    
"weapon_sg550",
    
"weapon_galil",
    
"weapon_famas",
    
"weapon_awp",
    
"weapon_m249",
    
"weapon_m4a1",
    
"weapon_tmp",
    
"weapon_g3sg1",
    
"weapon_deagle",
    
"weapon_sg552",
    
"weapon_ak47"
}  

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    for(new 
i=0;i<sizeof(g_weapon_ents);i++)
    
RegisterHam(Ham_Item_AddToPlayer,g_weapon_ents[i],"fw_Item_AddToPlayer");        
}
public 
fw_Item_AddToPlayer(ent,id)
{
    return 
HAM_SUPERCEDE;

Thank you very much.
Anggara_nothing 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 15:44.


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