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

[REQ] Disarmer based on round_start or player_spawn etc.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 01-17-2018 , 16:29   [REQ] Disarmer based on round_start or player_spawn etc.
Reply With Quote #1

Hi there,

In multigames players shouldn't kill each other at spawn so multigame maps spawns players without guns or knives but in some maps players can use that items from last round and kills player at spawn this brakes a lot. I need a plugin to disarm all players on round start.

You can use "sm_disarm @all" command

Thank you!

sorry for my bad english
__________________
spancer35 is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 01-17-2018 , 18:11   Re: [REQ] Disarmer based on round_start or player_spawn etc.
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <smlib>

#define StripConfig "configs/strip_mapconfig.cfg"
bool StripMap;

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"PlayerSpawn);
}

public 
Action PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));

    if (
StripMap)
    {
        
Client_RemoveAllWeapons(client""true);
    }
    
    return 
Plugin_Continue;
}

public 
void OnMapStart()
{
    
checkmapforstrip();
}

void checkmapforstrip()
{
    
char line[128], g_Config[PLATFORM_MAX_PATH], g_CurrentMap[128];
    
GetCurrentMap(g_CurrentMapsizeof(g_CurrentMap));
    
BuildPath(Path_SMg_Configsizeof(g_Config), StripConfig);

    
StripMap false;
    
File StripMaps;
    
StripMaps OpenFile(g_Config"r");

    if (
StripMaps != null)
    {
        while(
StripMaps.ReadLine(linesizeof(line)))
        {
            
TrimString(line);
            if (
StrEqual(lineg_CurrentMaptrue))
            {
                
StripMap true;
                break;
            }
        }
        
StripMaps.Close();
    }

Make a new config file strip_mapconfig.cfg in ./addons/sourcemod/configs and the maps where the guns need to be stripped (Every map on new line, without the .bsp extension). You need smlib to compile the plugin. Example config:

PHP Code:
mg_awp_multigames_csgo
mg_raphi_multigame 
__________________

Last edited by PinHeaDi; 01-17-2018 at 18:13.
PinHeaDi is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 01-17-2018 , 18:36   Re: [REQ] Disarmer based on round_start or player_spawn etc.
Reply With Quote #3

Works perfectly. Thank you so much!
__________________
spancer35 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 09:47.


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