AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to block the CS from give the default Glock/USP? (https://forums.alliedmods.net/showthread.php?t=88811)

dogandcat 03-29-2009 10:51

How to block the CS from give the default Glock/USP?
 
in my server their damage is higger tan an awp, and i dont want it free T_T
so, i was asking haw to block the cs from giving they weapons to players...

alan_el_more 03-29-2009 10:59

Re: How to block the CS from give the default Glock/USP?
 
look at this
http://forums.alliedmods.net/showthread.php?t=88591

dogandcat 03-29-2009 11:12

Re: How to block the CS from give the default Glock/USP?
 
i dont want it on every round, only in the first round, when they get in the server...

anakin_cstrike 03-29-2009 11:21

Re: How to block the CS from give the default Glock/USP?
 
Just make your own condition wich checks what you want.

ConnorMcLeod 03-29-2009 11:33

Re: How to block the CS from give the default Glock/USP?
 
Try this, should prevent to give weapons to a player that was dead when he spawn.

PHP Code:

/*    Copyright © 2009, ConnorMcLeod

    No Default Guns is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with No Default Guns; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "No Default Guns"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

const GUNS_BITSUM = ((1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE))

#define MAX_PLAYERS 32

new g_bFirstSpawn[MAX_PLAYERS+1]
new 
g_bRestart[MAX_PLAYERS+1]
new 
g_bDontGiveGun[MAX_PLAYERS+1]

new 
g_bRestarting
new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("TextMsg""Event_TextMsg_Restart""a""2&#Game_C""2&#Game_w")
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Pre")
    
RegisterHam(Ham_AddPlayerItem"player""Player_AddPlayerItem")

    
register_forward(FM_ClientPutInServer"ClientPutInServer")

    
g_iMaxPlayers get_maxplayers()
}

public 
ClientPutInServer(id)
{
    
g_bFirstSpawn[id] = true
    g_bRestart
[id] = false
}

public 
Event_TextMsg_Restart()
{
    
g_bRestarting true
}

public 
Event_HLTV_New_Round()
{
    if( 
g_bRestarting )
    {
        
g_bRestarting false
        
for(new id=1id<=g_iMaxPlayersid++)
        {
            if( 
is_user_alive(id) )
            {
                
g_bRestart[id] = true
            
}
        }
    }
}

public 
Player_Spawn_Pre(id)
{
    if( 
g_bFirstSpawn[id] )
    {
        
g_bFirstSpawn[id] = false
        
return
    }

    if( 
is_user_alive(id) && !g_bRestart[id] )
    {
        return
    }

    
g_bRestart[id] = false

    
if( CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT )
    {
        
g_bDontGiveGun[id] = true
    
}
}

public 
Player_AddPlayerItem(idiWeapon)
{
    if( !
g_bDontGiveGun[id] )
    {
        return 
HAM_IGNORED
    
}

    new 
szClassName[2]
    
pev(iWeaponpev_classnameszClassNamecharsmax(szClassName))
    if( 
szClassName[0] != 'w' )
    {
        return 
HAM_IGNORED
    
}

    if(    !( 
GUNS_BITSUM & (1<<cs_get_weapon_id(iWeapon)) )    )
    {
        return 
HAM_IGNORED
    
}    

    
g_bDontGiveGunid ] = false

    set_pev
(iWeaponpev_flagspev(iWeaponpev_flags) | FL_KILLME)
    
SetHamReturnInteger(0)
    return 
HAM_SUPERCEDE




All times are GMT -4. The time now is 08:56.

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