Raised This Month: $51 Target: $400
 12% 

Block weapon pickup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
livingstone
Junior Member
Join Date: Mar 2010
Old 03-25-2010 , 12:59   Block weapon pickup
Reply With Quote #1

can any1 make plugin that will block pickup of weapons when player say /block
livingstone is offline
master4life
Senior Member
Join Date: Mar 2006
Location: Germany
Old 03-25-2010 , 14:15   Re: Block weapon pickup
Reply With Quote #2

go try this

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

new boolg_bEnable32 ]; 

public 
plugin_init( ) {
    
register_plugin"Block Pickup""0.1""master4life" );
    
    
register_clcmd"say /block""CmdBlockPickup" );
    
    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerPickup" );
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerPickup" );
}

public 
client_putinserverid )
    
g_bEnableid ] = false;

public 
FwdHamPlayerPickupiEntityid )
    return 
g_bEnableid ] ? HAM_SUPERCEDE HAM_IGNORED

public CmdBlockPickupid )
    
g_bEnableid ] = !g_bEnableid ]; 
__________________


[img]http://img714.**************/img714/8612/33726.png[/img]
master4life is offline
Send a message via ICQ to master4life Send a message via MSN to master4life Send a message via Skype™ to master4life
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 03-25-2010 , 14:21   Re: Block weapon pickup
Reply With Quote #3

my server wont run with this. as my friends server wont run with this
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-25-2010 , 15:27   Re: Block weapon pickup
Reply With Quote #4

Quote:
Originally Posted by DIREKTOR View Post
my server wont run with this. as my friends server wont run with this
Code:
#include < amxmodx > #include < hamsandwich > new bool:g_bEnable[ 33 ]public plugin_init( ) {     register_plugin( "Block Pickup", "0.1", "master4life" );           register_clcmd( "say /block", "CmdBlockPickup" );           RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );     RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" ); } public client_putinserver( id )     g_bEnable[ id ] = false; public FwdHamPlayerPickup( iEntity, id )     return g_bEnable[ id ] ? HAM_SUPERCEDE : HAM_IGNORED; public CmdBlockPickup( id )     /* g_bEnable[ id ] = !g_bEnable[ id ]; */     /* Didn't know if it'd work, just to be safe */     g_bEnable[ id ] = g_bEnable[ id ] ? false : true;
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-25-2010 , 15:31   Re: Block weapon pickup
Reply With Quote #5

Quote:
Originally Posted by wrecked_ View Post
...
It works fine the way it was.

What I would do is make sure a player is touching the entities:
Code:
#include < amxmodx > #include < hamsandwich > // should be 33 with id as index, // or use 32 with id-1 as index new bool: g_bEnable[ 33 ]; new g_iMaxPlayers; public plugin_init( ) {     register_plugin( "Block Pickup", "0.1", "master4life" );         register_clcmd( "say /block", "CmdBlockPickup" );         RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );     RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );         g_iMaxPlayers = get_maxplayers( ); } public client_putinserver( id )     g_bEnable[ id ] = false; public FwdHamPlayerPickup( iEntity, id )     return ( 1 <= id <= g_iMaxPlayers && g_bEnable[ id ] ) ? HAM_SUPERCEDE : HAM_IGNORED public CmdBlockPickup( id )     g_bEnable[ id ] = !g_bEnable[ id ];
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 03-25-2010 , 15:53   Re: Block weapon pickup
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
It works fine the way it was.

What I would do is make sure a player is touching the entities:
Code:
#include < amxmodx > #include < hamsandwich > // should be 33 with id as index, // or use 32 with id-1 as index new bool: g_bEnable[ 33 ]; new g_iMaxPlayers; public plugin_init( ) {     register_plugin( "Block Pickup", "0.1", "master4life" );         register_clcmd( "say /block", "CmdBlockPickup" );         RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );     RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );         g_iMaxPlayers = get_maxplayers( ); } public client_putinserver( id )     g_bEnable[ id ] = false; public FwdHamPlayerPickup( iEntity, id )     return ( 1 <= id <= g_iMaxPlayers && g_bEnable[ id ] ) ? HAM_SUPERCEDE : HAM_IGNORED public CmdBlockPickup( id )     g_bEnable[ id ] = !g_bEnable[ id ];

exolent please can you make this only when Terror say /block
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-25-2010 , 16:51   Re: Block weapon pickup
Reply With Quote #7

Code:
#include < amxmodx > #include < cstrike > #include < hamsandwich > #define MAX_PLAYERS 32 new bool: g_bEnable[ MAX_PLAYERS + 1 ]; new g_iMaxPlayers; public plugin_init( ) {     register_plugin( "Block Pickup", "0.1", "master4life" );         register_clcmd( "say /block", "CmdBlockPickup" );         RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );     RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );         g_iMaxPlayers = get_maxplayers( ); } public client_putinserver( id )     g_bEnable[ id ] = false; public FwdHamPlayerPickup( iEntity, id ) {     if( ( 1 <= id <= g_iMaxPlayers )     &&  g_bEnable[ id ] )     {         if( cs_get_user_team( id ) == CS_TEAM_T )             return HAM_SUPERCEDE;         else             g_bEnable[ id ] = false;     }         return HAM_IGNORED; } public CmdBlockPickup( id )     g_bEnable[ id ] = ( !g_bEnable[ id ] && cs_get_user_team( id ) == CS_TEAM_T );
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 03-26-2010 at 17:08.
Exolent[jNr] is offline
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 03-26-2010 , 07:03   Re: Block weapon pickup
Reply With Quote #8

unable co compile
error:/groups/amxmodx/tmp3/textoWewuK.sma(25) : error 017: undefined symbol "cs_get_user_team"
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-26-2010 , 07:06   Re: Block weapon pickup
Reply With Quote #9

#include <cstrike>

at the top.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-26-2010 , 09:57   Re: Block weapon pickup
Reply With Quote #10

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
 
new bool:g_BlockPickup[33];
 
public 
plugin_init()
{
        
register_plugin("Block Pickup""1.0""AMXX Community");
 
        
register_clcmd("say /block""SayBlock");
 
        
register_touch("weaponbox""player""BlockPickup");
        
register_touch("armoury_entity""player""BlockPickup");
        
register_touch("weapon_shield""player""BlockPickup");
}
 
public 
client_putinserver(Client)
        
g_BlockPickup[Client] = false;
 
public 
SayBlock(Client)
        if (
cs_get_user_team(Client) == CS_TEAM_T)
                
g_BlockPickup[Client] = !g_BlockPickup[Client];
 
public 
BlockPickup(EntityClient)
        return (
g_BlockPickup[Client] && cs_get_user_team(Client) == CS_TEAM_T) ? PLUGIN_HANDLED PLUGIN_CONTINUE
__________________

Last edited by hleV; 03-26-2010 at 10:01.
hleV is offline
Old 05-03-2017, 14:54
CrazY.
This message has been deleted by CrazY.. Reason: Ops, my mistake haha
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 08:37.


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