Raised This Month: $32 Target: $400
 8% 

Remove weapons on round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnowHP
Senior Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 11-15-2017 , 09:55   Remove weapons on round start
Reply With Quote #1

I want a plugin to remove weapons from all players on round start for my dr server.
__________________
SnowHP is offline
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 11-15-2017 , 10:11   Re: Remove weapons on round start
Reply With Quote #2

.sp is attached. Untested but should work.
Attached Files
File Type: sp Get Plugin or Get Source (bStripWeapons.sp - 524 views - 1.3 KB)

Last edited by Bobakanoosh; 11-15-2017 at 10:11.
Bobakanoosh is offline
whtevrwt
AlliedModders Donor
Join Date: Apr 2015
Old 11-15-2017 , 10:30   Re: Remove weapons on round start
Reply With Quote #3

Code:
] find mp_ct_default
"mp_ct_default_grenades" = "" client replicated                                  - The default grenades that the CTs will spawn with.  To give multiple grenades, s
"mp_ct_default_melee" = "weapon_knife" client replicated                         - The default melee weapon that the CTs will spawn with.  Even if this is blank, a
"mp_ct_default_primary" = "" client replicated                                   - The default primary (rifle) weapon that the CTs will spawn with
"mp_ct_default_secondary" = "weapon_hkp2000" client replicated                   - The default secondary (pistol) weapon that the CTs will spawn with
] find mp_t_default
"mp_t_default_grenades" = "" client replicated                                   - The default grenades that the Ts will spawn with.  To give multiple grenades, se
"mp_t_default_melee" = "weapon_knife" client replicated                          - The default melee weapon that the Ts will spawn with
"mp_t_default_primary" = "" client replicated                                    - The default primary (rifle) weapon that the Ts will spawn with
"mp_t_default_secondary" = "weapon_glock" client replicated                      - The default secondary (pistol) weapon that the Ts will spawn with
__________________
whtevrwt is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 11-15-2017 , 11:56   Re: Remove weapons on round start
Reply With Quote #4

Quote:
Originally Posted by whtevrwt View Post
Code:
] find mp_ct_default
"mp_ct_default_grenades" = "" client replicated                                  - The default grenades that the CTs will spawn with.  To give multiple grenades, s
"mp_ct_default_melee" = "weapon_knife" client replicated                         - The default melee weapon that the CTs will spawn with.  Even if this is blank, a
"mp_ct_default_primary" = "" client replicated                                   - The default primary (rifle) weapon that the CTs will spawn with
"mp_ct_default_secondary" = "weapon_hkp2000" client replicated                   - The default secondary (pistol) weapon that the CTs will spawn with
] find mp_t_default
"mp_t_default_grenades" = "" client replicated                                   - The default grenades that the Ts will spawn with.  To give multiple grenades, se
"mp_t_default_melee" = "weapon_knife" client replicated                          - The default melee weapon that the Ts will spawn with
"mp_t_default_primary" = "" client replicated                                    - The default primary (rifle) weapon that the Ts will spawn with
"mp_t_default_secondary" = "weapon_glock" client replicated                      - The default secondary (pistol) weapon that the Ts will spawn with
He ask for the weapons to be removed every round, that cvars are to change start weapons only.
PHP Code:
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn)
}

public 
Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"))
    
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        for(new 
04i++)
        {
            new 
ent
            
            
while((ent GetPlayerWeaponSlot(clienti)) != -1)
            {
                
RemovePlayerItem(clientent)
                
AcceptEntityInput(ent"Kill")
            }
        }
        
        
GivePlayerItem(client"weapon_knife")
    }

Vaggelis is offline
SnowHP
Senior Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 11-15-2017 , 14:35   Re: Remove weapons on round start
Reply With Quote #5

Thanks for help
__________________
SnowHP is offline
whtevrwt
AlliedModders Donor
Join Date: Apr 2015
Old 11-15-2017 , 14:58   Re: Remove weapons on round start
Reply With Quote #6

Quote:
Originally Posted by Vaggelis View Post
He ask for the weapons to be removed every round, that cvars are to change start weapons only.
PHP Code:
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn)
}

public 
Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"))
    
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        for(new 
04i++)
        {
            new 
ent
            
            
while((ent GetPlayerWeaponSlot(clienti)) != -1)
            {
                
RemovePlayerItem(clientent)
                
AcceptEntityInput(ent"Kill")
            }
        }
        
        
GivePlayerItem(client"weapon_knife")
    }

That’s exactly what those cvars do.
__________________
whtevrwt is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 11-15-2017 , 15:17   Re: Remove weapons on round start
Reply With Quote #7

Quote:
Originally Posted by whtevrwt View Post
That’s exactly what those cvars do.
Are u brain damaged or sth? He wants every round all players to be with knife only.
Vaggelis is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-15-2017 , 15:28   Re: Remove weapons on round start
Reply With Quote #8

Quote:
Originally Posted by whtevrwt View Post
That’s exactly what those cvars do.
Quote:
Originally Posted by Vaggelis View Post
Are u brain damaged or sth? He wants every round all players to be with knife only.
No need to be mean.
The cvars you listed whtevrwt are for giving players default weapons, weapons from a previous round will override those convars.
Mitchell is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 11-15-2017 , 15:36   Re: Remove weapons on round start
Reply With Quote #9

Quote:
Originally Posted by Mitchell View Post
No need to be mean.
The cvars you listed whtevrwt are for giving players default weapons, weapons from a previous round will override those convars.
Thank you for telling him analytically what these cvars do. Sorry, i didn't want to be mean but
i get mad easily.
Vaggelis is offline
whtevrwt
AlliedModders Donor
Join Date: Apr 2015
Old 11-15-2017 , 16:33   Re: Remove weapons on round start
Reply With Quote #10

Quote:
Originally Posted by Mitchell View Post
No need to be mean.
The cvars you listed whtevrwt are for giving players default weapons, weapons from a previous round will override those convars.
Oh ok. I thought at every round start it would automatically reset all players. I’ve never experienced players still starting with the same weapons from the previous round. Now I know.
__________________
whtevrwt is offline
Reply


Thread Tools
Display Modes

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 00:20.


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