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

Is there a way to clear all map start weapons? [CSGO]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 05-12-2018 , 17:46   Is there a way to clear all map start weapons? [CSGO]
Reply With Quote #1

The map that I want to run my server on has preset weapons that spawn by default

Is there a way to remove them completely so that when you spawn you have no weapon yet
__________________
Ayyylmao
malec321 is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 05-12-2018 , 23:34   Re: Is there a way to clear all map start weapons? [CSGO]
Reply With Quote #2

Code:
mp_weapons_allow_map_placed 0
or

https://forums.alliedmods.net/showthread.php?t=39439
__________________
coding & free software
shanapu is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 05-15-2018 , 18:24   Re: Is there a way to clear all map start weapons? [CSGO]
Reply With Quote #3

Quote:
Originally Posted by malec321 View Post
The map that I want to run my server on has preset weapons that spawn by default

Is there a way to remove them completely so that when you spawn you have no weapon yet
PHP Code:
char[] sWeapon = new char[MAX_NAME_LENGTH];
        
for (
int i MaxClientsGetMaxEntities(); ++i)
{
    if (
IsValidEdict(i))
    { 
        
GetEdictClassname(isWeaponMAX_NAME_LENGTH);
                
        if (
StrContains(sWeapon"weapon_") != -1)
            
AcceptEntityInput(i"Kill");
    }

__________________

Last edited by LenHard; 05-15-2018 at 18:25.
LenHard is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 05-15-2018 , 18:46   Re: Is there a way to clear all map start weapons? [CSGO]
Reply With Quote #4

Quote:
Originally Posted by LenHard View Post
PHP Code:
char[] sWeapon = new char[MAX_NAME_LENGTH];
        
for (
int i MaxClientsGetMaxEntities(); ++i)
{
    if (
IsValidEdict(i))
    { 
        
GetEdictClassname(isWeaponMAX_NAME_LENGTH);
                
        if (
StrContains(sWeapon"weapon_") != -1)
            
AcceptEntityInput(i"Kill");
    }


if you really want to loop all weapons, you can save yourself some cpu time using FindEntityByClassname with a wildcard.

PHP Code:
int ent = -1;
while ((
ent FindEntityByClassname("weapon_*") != -1)
{
    
AcceptEntityInput(ent"Kill");

headline 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 04:12.


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