Raised This Month: $ Target: $400
 0% 

[REQ] Help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 06-30-2015 , 22:01   [REQ] Help please
Reply With Quote #1

hey i was edit the basecommands/map.sp when i change map from menu or by !map i want execing that commands ;
Code:
ServerCommand("mp_timelimit 0"); 
ServerCommand("mp_maxrounds 1"); 
ServerCommand("sm_cvar mp_timelimit 0"); 
ServerCommand("sm_cvar  mp_maxrounds 1"); 
ServerCommand("sm_rcon sm_slay @all"); 
ServerCommand("sm_cvar nextlevel %s", ); 
ServerCommand("sm_cvar mp_respawn_on_death_ct 0"); 
ServerCommand("sm_cvar mp_respawn_on_death_t 0"); 
ServerCommand("sm_msay Harita degiseceginden oyuncular oldurulmustur!"); 
ServerCommand("sm_evilrocket @all");
when i change map from menu that commands execing and !map too. but when i cahnge from !map i have problem like that ;

Code:
*Dead* Spancer : !map inferno
[SM] Map changing to inferno 
[SM] Server Cvar 'nextlevel' changed to inferno
and server can't found named inferno map server bugging somebody can edit that plugin

just edit after public Action:Command_Map(client, args) thank you! (sorry for my very bad english )

PHP Code:
/** 
 * vim: set ts=4 : 
 * ============================================================================= 
 * SourceMod Basecommands Plugin 
 * Provides map functionality 
 * 
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved. 
 * ============================================================================= 
 * 
 * This program is free software; you can redistribute it and/or modify it under 
 * the terms of the GNU General Public License, version 3.0, 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 
 * this program.  If not, see <http://www.gnu.org/licenses/>. 
 * 
 * As a special exception, AlliedModders LLC gives you permission to link the 
 * code of this program (as well as its derivative works) to "Half-Life 2," the 
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 
 * by the Valve Corporation.  You must obey the GNU General Public License in 
 * all respects for all other code used.  Additionally, AlliedModders LLC grants 
 * this exception to all derivative works.  AlliedModders LLC defines further 
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 
 * or <http://www.sourcemod.net/license.php>. 
 * 
 * Version: $Id$ 
 */ 
  
public MenuHandler_ChangeMap(Handle:menuMenuAction:actionparam1param2

    if (
action == MenuAction_Cancel
    { 
        if (
param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE
        { 
            
DisplayTopMenu(hTopMenuparam1TopMenuPosition_LastCategory); 
        } 
    } 
    else if (
action == MenuAction_Select
    { 
        
decl String:map[64]; 
         
        
GetMenuItem(menuparam2mapsizeof(map)); 
     
        
ShowActivity2(param1"[SM] ""%t""Changing map"map); 

        
LogAction(param1, -1"\"%L\" changed map to \"%s\""param1map); 

ServerCommand("mp_timelimit 0"); 
ServerCommand("mp_maxrounds 1"); 
ServerCommand("sm_cvar mp_timelimit 0"); 
ServerCommand("sm_cvar  mp_maxrounds 1"); 
ServerCommand("sm_rcon sm_slay @all"); 
ServerCommand("sm_cvar nextlevel %s"map); 
ServerCommand("sm_cvar mp_respawn_on_death_ct 0"); 
ServerCommand("sm_cvar mp_respawn_on_death_t 0"); 
ServerCommand("sm_msay Harita degiseceginden oyuncular oldurulmustur!"); 
ServerCommand("sm_evilrocket @all"); 
    } 
    else if (
action == MenuAction_Display
    { 
        
decl String:title[128]; 
        
Format(titlesizeof(title), "%T""Please select a map"param1); 
        
SetPanelTitle(Handle:param2title); 
    } 


public 
AdminMenu_Map(Handle:topmenu,  
                              
TopMenuAction:action
                              
TopMenuObject:object_id
                              
param
                              
String:buffer[], 
                              
maxlength

    if (
action == TopMenuAction_DisplayOption
    { 
        
Format(buffermaxlength"%T""Choose Map"param); 
    } 
    else if (
action == TopMenuAction_SelectOption
    { 
        
DisplayMenu(g_MapListparamMENU_TIME_FOREVER); 
    } 


public 
Action:Command_Map(clientargs

    if (
args 1
    { 
        
ReplyToCommand(client"[SM] Usage: sm_map <map>"); 
        return 
Plugin_Handled
    } 

    
decl String:map[64]; 
    
GetCmdArg(1mapsizeof(map)); 

    if (!
IsMapValid(map)) 
    { 
        
ReplyToCommand(client"[SM] %t""Map was not found"map); 
        return 
Plugin_Handled
    } 

    
ShowActivity2(client"[SM] ""%t""Changing map"map); 

    
LogAction(client, -1"\"%L\" changed map to \"%s\""clientmap);  
ServerCommand("mp_timelimit 0"); 
ServerCommand("mp_maxrounds 1"); 
ServerCommand("sm_cvar mp_timelimit 0"); 
ServerCommand("sm_cvar  mp_maxrounds 1"); 
ServerCommand("sm_rcon sm_slay @all"); 
ServerCommand("sm_cvar nextlevel %s"map); 
ServerCommand("sm_cvar mp_respawn_on_death_ct 0"); 
ServerCommand("sm_cvar mp_respawn_on_death_t 0"); 
ServerCommand("sm_msay Harita degiseceginden oyuncular oldurulmustur!"); 
ServerCommand("sm_evilrocket @all");
    new 
Handle:dp;  
    
WritePackString(dpmap); 

    return 
Plugin_Handled


new 
Handle:g_map_array INVALID_HANDLE
new 
g_map_serial = -1

LoadMapList(Handle:menu

    new 
Handle:map_array
     
    if ((
map_array ReadMapList(g_map_array
            
g_map_serial
            
"sm_map menu"
            
MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT|MAPLIST_FLAG_MAPSFOLDER)) 
        != 
INVALID_HANDLE
    { 
        
g_map_array map_array
    } 
     
    if (
g_map_array == INVALID_HANDLE
    { 
        return 
0
    } 
     
    
RemoveAllMenuItems(menu); 
     
    
decl String:map_name[64]; 
    new 
map_count GetArraySize(g_map_array); 
     
    for (new 
0map_counti++) 
    { 
        
GetArrayString(g_map_arrayimap_namesizeof(map_name)); 
        
AddMenuItem(menumap_namemap_name); 

    } 
     
    return 
map_count


Last edited by spancer35; 06-30-2015 at 22:02.
spancer35 is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 06-30-2015 , 22:06   Re: [REQ] Help please
Reply With Quote #2

Quote:
Originally Posted by spancer35 View Post
Code:
*Dead* Spancer : !map inferno
[SM] Map changing to inferno 
[SM] Server Cvar 'nextlevel' changed to inferno
and server can't found named inferno map server bugging somebody can edit that plugin
The map name is "de_inferno", not only "inferno".

Just instruct your admins to use proper map names with !map.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-30-2015 , 23:45   Re: [REQ] Help please
Reply With Quote #3

The gameserver already autoexecutes configs for maps as they load....
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 05:15.


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