Raised This Month: $ Target: $400
 0% 

How to completely block spawn weapons?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 03-15-2013 , 12:04   How to completely block spawn weapons?
Reply With Quote #1

How to completely block spawn weapons with no weappickup hud send?
i tried to use strip_user_weapons on PlayerSpawn forward
but i can't block weapon pickup hud send.

sry for my english

Last edited by 11922911; 03-15-2013 at 12:05.
11922911 is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 03-16-2013 , 06:35   Re: How to completely block spawn weapons?
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=1957
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-16-2013 , 06:41   Re: How to completely block spawn weapons?
Reply With Quote #3

Quote:
Originally Posted by naven View Post
You may want to read again ... that's not what was asked for.
hornet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2013 , 06:46   Re: How to completely block spawn weapons?
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?p=458317
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-16-2013 , 06:56   Re: How to completely block spawn weapons?
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Are you sure Connor?

The way I interpreted it, is that he wants to block the standard spawn weapons without having to strip them. Something like this:
Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #define m_iDefaultItems     120 public plugin_init()     RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawn_Pre" ); public ham_PlayerSpawn_Pre( id )     set_pdata_int( id, m_iDefaultItems, 1 );
hornet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2013 , 07:05   Re: How to completely block spawn weapons?
Reply With Quote #6

You are right.
Need to handle maps with special weapons though.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 03-16-2013 , 07:14   Re: How to completely block spawn weapons?
Reply With Quote #7

it's exactly what i wanted.
thank you!!

Last edited by 11922911; 03-16-2013 at 08:47.
11922911 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-16-2013 , 07:52   Re: How to completely block spawn weapons?
Reply With Quote #8

It could be extended to this to remove map added weapons:
Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #define m_iDefaultItems     120 public plugin_init() {     RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawn_Pre" );         engfunc( EngFunc_RemoveEntity, engfunc( EngFunc_FindEntityByString, -1, "classname", "game_player_equip" ) ); }     public ham_PlayerSpawn_Pre( id )     set_pdata_int( id, m_iDefaultItems, 1 );
hornet is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 03-16-2013 , 08:47   Re: How to completely block spawn weapons?
Reply With Quote #9

... ...

something's not right ?
when i using your code, I will lost my health/armor/weapon/ammo .. in hud...


Last edited by 11922911; 05-10-2013 at 05:05.
11922911 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2013 , 09:04   Re: How to completely block spawn weapons?
Reply With Quote #10

Try :

Check if primo spawning player have a model set.

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

#tryinclude <cstrike_pdatas>

#if !defined _cbaseentity_included
        #assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \
                
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   \
                
2. Put it into amxmodx/scripting/include/ folder   \
                
3. Compile this plugin locallydetailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \
                
4. Install compiled plugindetailswiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif

#define PLUGIN "No Spawn Weapons"
#define VERSION "0.0.1"

const WEAPON_SUIT 31
const WEAPON_SUIT_BIT 1<<WEAPON_SUIT

new g_bConnectedPlayers[33 char]

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" )
    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn"false)
}

public 
client_connect(id)
{
    
g_bConnectedPlayers{id} = false
}

public 
client_putinserver(id)
{
    
g_bConnectedPlayers{id} = true
}

public 
OnCBasePlayer_Spawnid )
{
    if( 
pev_valid(id) == && (<= get_pdata_int(idm_iTeam) <= 2) )
    {
        
set_pdata_bool(idm_bHasReceivedDefItemstrue)
        new 
weapons pev(idpev_weapons)
        if( ~
weapons WEAPON_SUIT_BIT )
        {
            
set_pev(idpev_weaponsweapons WEAPON_SUIT_BIT)
        }
        return 
HAM_HANDLED
    
}
    return 
HAM_IGNORED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-16-2013 at 09:14.
ConnorMcLeod is offline
Old 03-16-2013, 21:43
11922911
This message has been deleted by 11922911.
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 21:45.


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