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

How to block the CS from give the default Glock/USP?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dogandcat
BANNED
Join Date: Jan 2009
Old 03-29-2009 , 10:51   How to block the CS from give the default Glock/USP?
Reply With Quote #1

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...
dogandcat is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-29-2009 , 10:59   Re: How to block the CS from give the default Glock/USP?
Reply With Quote #2

look at this
http://forums.alliedmods.net/showthread.php?t=88591
__________________
alan_el_more is offline
dogandcat
BANNED
Join Date: Jan 2009
Old 03-29-2009 , 11:12   Re: How to block the CS from give the default Glock/USP?
Reply With Quote #3

i dont want it on every round, only in the first round, when they get in the server...
dogandcat is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-29-2009 , 11:21   Re: How to block the CS from give the default Glock/USP?
Reply With Quote #4

Just make your own condition wich checks what you want.
__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-29-2009 , 11:33   Re: How to block the CS from give the default Glock/USP?
Reply With Quote #5

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

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 19:26.


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