AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to completely block spawn weapons? (https://forums.alliedmods.net/showthread.php?t=210856)

11922911 03-15-2013 12:04

How to completely block spawn weapons?
 
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

naven 03-16-2013 06:35

Re: How to completely block spawn weapons?
 
https://forums.alliedmods.net/showthread.php?t=1957

hornet 03-16-2013 06:41

Re: How to completely block spawn weapons?
 
Quote:

Originally Posted by naven (Post 1913622)

You may want to read again ... that's not what was asked for.

ConnorMcLeod 03-16-2013 06:46

Re: How to completely block spawn weapons?
 
http://forums.alliedmods.net/showthread.php?p=458317

hornet 03-16-2013 06:56

Re: How to completely block spawn weapons?
 
Quote:

Originally Posted by ConnorMcLeod (Post 1913630)

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 );

ConnorMcLeod 03-16-2013 07:05

Re: How to completely block spawn weapons?
 
You are right.
Need to handle maps with special weapons though.

11922911 03-16-2013 07:14

Re: How to completely block spawn weapons?
 
it's exactly what i wanted.
thank you!!

hornet 03-16-2013 07:52

Re: How to completely block spawn weapons?
 
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 );

11922911 03-16-2013 08:47

Re: How to completely block spawn weapons?
 
... ...

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

http://i.imgur.com/AeSlThX.jpg

ConnorMcLeod 03-16-2013 09:04

Re: How to completely block spawn weapons?
 
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




All times are GMT -4. The time now is 21:45.

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