Raised This Month: $ Target: $400
 0% 

[L4D2 & L4D] Hunter Training Map Multiplayer Enabler


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
eyeonus
Member
Join Date: Jul 2009
Old 08-22-2010 , 22:34   Re: [L4D2 & L4D] Hunter Training Map Multiplayer Enabler
Reply With Quote #14

Quote:
Originally Posted by McFlurry View Post
PHP Code:
public OnMapStart()
new 
String:map[30];
GetCurrentMap(mapsizeof(map));
if(
StrEqual(map"htmname"false) || StrEqual(map"htmname2"false) || StrEqual(map"htmname3"false))
{
    
//register the command here

That should fix the issue.
Two things:
1) My maps begin with "hunter_training". They are "hunter_training.bsp", "hunter_training_map.bsp", and "hunter_training_c21.bsp". Is it possible to check just for "hunter_training", instead of having to do a check for each map individually?

2) I don't like the idea of making this plugin only work on my maps. Version 1.3.1 is fixed so that the plugin will not interfere with other plugins when it is turned off. I can use your example code to check to see if my map is the one being loaded and turn the plugin off:

PHP Code:
public OnMapStart()
new 
String:map[30];
GetCurrentMap(mapsizeof(map));
if(!
StrContains("hunter_training")) //see if "hunter_training" is in the name of the map
{
   
ServerCommand("l4d2_htm_mp_enable 0");

Assuming the StrContains bit works as I think, the above code would check to see if the map is one of mine, and if not, turn the plugin off. This would mean that the line "l4d2_htm_mp_enable 0" would not be needed in the server.cfg file, but would still allow server admins to enable the plugin on a different map if they wished.

I can see why it is desirable for this plugin to not interfere with other plugins. I can also see instances where a player would want to manually turn on this plugin- for example, if they wish to enable multiplayer training on a different map. On L4D2, such training requires this plugin- or at least one that does everything this one does- unless a listen server is used, in which case this plugin isn't needed in the first place.

To that end, I am thinking of adding a command to the plugin that would run the config that the Live Fire Course uses:

PHP Code:
public start_training(Handle:convar, const String:oldValue[], const String:newValue[]) {
    if (
GetConVarBool(training_toggle)) {
        
ServerCommand("l4d2_htm_mp_enable 1;god 1;vs_max_team_switches 99;sb_all_bot_team 1")
    } else {
        
ServerCommand("l4d2_htm_mp_enable 0")
    } 
Combined with the above, this would make it possible to do training on ANY map manually, and would cause the plugin to only be automatically turned on for HTM.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2htm-multiplayer-enabler-v2.rc1.sp - 259 views - 4.4 KB)

Last edited by eyeonus; 08-22-2010 at 22:50.
eyeonus is offline
 



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 14:36.


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