Raised This Month: $ Target: $400
 0% 

[L4D2 & L4D] Hunter Training Map Multiplayer Enabler


Post New Thread Reply   
 
Thread Tools Display Modes
Author
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Plugin ID:
1609
Plugin Version:
2.5.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Enables "Hunter Training Map" to be run on a dedicated server and allows "Live Fire Course" settings on any map.
    Old 08-22-2010 , 20:35   Re: [L4D2 & L4D] Hunter Training Map Multiplayer Enabler
    Reply With Quote #1

    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.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    eyeonus
    Member
    Join Date: Jul 2009
    Old 08-22-2010 , 22:34   Re: [L4D2 & L4D] Hunter Training Map Multiplayer Enabler
    Reply With Quote #2

    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 - 256 views - 4.4 KB)

    Last edited by eyeonus; 08-22-2010 at 22:50.
    eyeonus is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 08-22-2010 , 23:13   Re: [L4D2 & L4D] Hunter Training Map Multiplayer Enabler
    Reply With Quote #3

    I'm not sure if the new version fixes it properly, you are registering the command on plugin start.
    PHP Code:
    if(StrContains(map"hunter_training"false))
    {
        
    RegConsoleCmd("give"give_health);
        
    RegConsoleCmd("z_spawn"spawn_zombie);

    I suggest this would fix it properly. Also your new version || stands for "or" so if 1 condition meets will go on to perform the action use && which pretty much means and so it will make sure all conditions meet before going on.
    __________________

    Last edited by McFlurry; 08-22-2010 at 23:37.
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    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:19.


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