Raised This Month: $32 Target: $400
 8% 

[REQ] Terrorists CAN NOT pickup any weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blanko
Senior Member
Join Date: Aug 2008
Old 06-07-2016 , 21:32   [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #1

Terrorists CAN NOT pickup any weapon (Knive only)
__________________
blanko is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 06-08-2016 , 00:11   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #2

Try this
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >

#define MAX_PLAYERS 32

new boolg_bEnableMAX_PLAYERS ];

new 
g_iMaxPlayers;

public 
plugin_init( ) {
    
register_plugin("Plugin""1.0""AlliedmodS")
    
    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerPickup" );
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerPickup" );
    
    
g_iMaxPlayers get_maxplayers( );
}

public 
client_putinserverid )
    
g_bEnableid ] = true;

public 
FwdHamPlayerPickupiEntityid )
{
    if( ( 
<= id <= g_iMaxPlayers )
    &&  
g_bEnableid ] )
{
    if( 
cs_get_user_teamid ) == CS_TEAM_T )
        return 
HAM_SUPERCEDE;
        else
            
g_bEnableid ] = false;
    }
    
    return 
HAM_IGNORED;
}

// Coded by Exolent[jNr] 
__________________
Artifact is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-08-2016 , 02:54   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #3

Your code is wrong. It will check if user is terrorist and if it's CT then it will set boolean to false, after that if ct becomes terrorist it won't check team because first of all is checked the boolean and it won't work.

Also, don't use armoury cause it's useless.It has only vesthelm.
Read this:https://forums.alliedmods.net/showthread.php?t=235139

Blanco, do you want terrorist can pickup shield?
Cause it's neither weapon or armoury.

Last edited by siriusmd99; 06-08-2016 at 02:55.
siriusmd99 is offline
blanko
Senior Member
Join Date: Aug 2008
Old 06-08-2016 , 08:10   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #4

Quote:
Originally Posted by siriusmd99 View Post
Your code is wrong. It will check if user is terrorist and if it's CT then it will set boolean to false, after that if ct becomes terrorist it won't check team because first of all is checked the boolean and it won't work.

Also, don't use armoury cause it's useless.It has only vesthelm.
Read this:https://forums.alliedmods.net/showthread.php?t=235139

Blanco, do you want terrorist can pickup shield?
Cause it's neither weapon or armoury.
I disabled shield on amx_restrict to avoid some bugs on the game but I think you can keep them available on the code in case players ask it back on game since they are not weapon. Thank you.
__________________
blanko is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-08-2016 , 10:58   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #5

I think u forgot to say "pickup and buy" because they can also buy weapons. I thought it shall block also buy because you said knife only.
So here we go:

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>

#define VERSION "0.0.1"
#define PLUGIN "Block Terrorists Weapons"
#define AUTHOR "ConnorMcLeod, Edit : siriusmd99"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("buy""ClientCommand_Buy")
    
register_clcmd("bUy""ClientCommand_Buy")
    
register_clcmd("buY""ClientCommand_Buy")
    
register_clcmd("bUY""ClientCommand_Buy")
    
register_clcmd("Buy""ClientCommand_Buy")
    
register_clcmd("BUy""ClientCommand_Buy")
    
register_clcmd("BuY""ClientCommand_Buy")
    
register_clcmd("BUY""ClientCommand_Buy")
    
    
register_touch("weaponbox""player""Block_Weapons"); 
    
register_touch("weapon_shield""player""Block_Weapons");
}

public 
Block_Weapons(entid

    if(
cs_get_user_team(id) == CS_TEAM_T)
    return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE
}  

public 
ClientCommand_Buy(id)
{
    if( 
cs_get_user_team(id) == CS_TEAM_T )
    return 
PLUGIN_HANDLED_MAIN
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache()
{

    new 
iEnt create_entity("info_map_parameters")
    
DispatchKeyValue(iEnt"buying""1")
    
DispatchSpawn(iEnt)
}

public 
pfn_keyvalueiEnt 
{
    new 
szClassName[32], szCrap[2]
    
copy_keyvalue(szClassNamecharsmax(szClassName), szCrapcharsmax(szCrap), szCrapcharsmax(szCrap)) 
    if( 
equal("info_map_parameters"szClassName) )
    {
        
remove_entity(iEnt)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_cfg()
{
    
set_cvar_float("sv_restart"1.0)

siriusmd99 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-09-2016 , 11:37   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #6

Quote:
Also, don't use armoury cause it's useless.It has only vesthelm.
What? armoury_entity can hold weapons(used on maps with ground weapons).
__________________

Last edited by HamletEagle; 06-09-2016 at 11:38.
HamletEagle is offline
blanko
Senior Member
Join Date: Aug 2008
Old 06-09-2016 , 16:50   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #7

Looks like it works fine, thank you siriusmd99!
__________________
blanko is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-09-2016 , 17:56   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
What? armoury_entity can hold weapons(used on maps with ground weapons).
Look in the link I posted above

Connor said:
"// note : iId can hold non weapon type : CSW_VEST and CSW_VESTHELM
// Weapons type that don't exist in armouries : famas, galil, ump45, sg550, all pistols, knife, c4
}"

I just trusted him because he's a good coder... That's all..
siriusmd99 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-09-2016 , 23:49   Re: [REQ] Terrorists CAN NOT pickup any weapon
Reply With Quote #9

He did not say armoury has only vesthelm, thst's what you understood.
__________________
HamletEagle 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 17:01.


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