Results 1 to 10 of 10
  1. #1

    Change map and/or mode in-game commands

    Hello, I am in need of a BF4 plugin that will allow me to change the map (preferably not limited to those in maplist) and/or change the game mode with a single command in-game. Basically, something like !setmap (map) (optional: mode). It would need to not change any server settings, and revert back to default mode/maplist after that round. Also would be nice if it was compatible with the / to hide the command.

    I've looked around and can't find something that fits these needs, so help is appreciated!

  2. #2
    In order to make your custom scripts (in-game commands, weapon limiting modes etc.), You will need to use such plugins that allows you to write your own scripts inside those plugins. ProconRulz plugin is one of the most used plugin for that matter.

    Install ProconRulz here, follow instructions in the first post:
    https://forum.myrcon.com/showthread....-admin-actions

    After you successfully configured the plugin, use this code:


    (not tested)
    Code:
    On Say;Admin;Text !setmap;
        if %targettext% == 0; PlayerSay Usage: !setmap <mapname> <gamemode>;PlayerSay Example: !setmap MP_Prison conquest;end
        Exec mapList.add %targettext% 1 0
        Exec mapList.setNextMapIndex 0
        Set %ini_setmap_mapandmode% %targettext%
    
    On Round;
        Set %currentmapandmode% %m% %mm%
        if %currentmapandmode% == %ini_setmap_mapandmode%; Exec mapList.remove 0

    The code above will add the mapname and mapmode you specified at the top of your existing maplist (internal index number is 0)
    Then it will set the nextmap to that map you just added to list. Once that map and game mode is loaded, map will be deleted from your maplist, although you will still be able to play it for one round

    I didnt add any "changing map immidiately" part because most players just change map without thinking of ending the round to save scores first.

    So !endround first to save current map scores,
    then use !nextlevel to change to next map in line (which would be the one you've set)

    EDIT: In order to use !endround and !nextlevel commands, you will need to enable "In-Game Admin" plugin in your Procon client
    Last edited by BuRockK; 27-10-2016 at 19:12.

  3. #3
    You can use user-friendly map names but in the code ive set it to match the map name used in the command to the map name used by server (internal map name) to be able to verify that the map which just started is the same map you wanted to change to with the given map mode.

    If you want i can delete that part but then you would have to manually remove the map entry from your maplist (you said you didnt want the original maplist changed so it needs to be deleted after its loaded)

    EDIT:
    You can find everything you need about server related commands or map names and modes etc. with the server admin doc. Download the latest one:
    https://forum.myrcon.com/showthread....st-Server-Docs

    EDIT 2: I might be wrong about the mapname you get with %m% being an internal map name. If this is wrong, anyone, pls let me know as i dont have any server to even test this. If im wrong, entering user-friendly map names shouldnt be a problem.
    Last edited by BuRockK; 27-10-2016 at 19:53.

  4. #4
    Thanks! I also can't seem to find the !endround ability. It doesn't seem to be setup or something (I apologize. I am not the actual server owner, just an admin who only has access to ingame commands. So I have like, no clue about anything XD)

  5. #5
    Like, I can skip levels. I just can't do the ending a round, let alone determining who wins. I tried the command and it didn't work.

  6. #6
    Ok so we added the code, and when I type !setmap it gives me the example, but when I try to type in the map name and mode nothing happens. Checked the upcoming map and it didn't change. Is it possibly deleting the map before it loads?

    Thanks!

    Edit: It displays:

    Usage: !setmap <mapname> <gamemode>
    and
    Example: !setmap MP_Prison conquest
    Last edited by Link4134; 27-10-2016 at 23:08. Reason: Added important info

  7. #7
    Quote Originally Posted by Link4134 View Post
    Ok so we added the code, and when I type !setmap it gives me the example, but when I try to type in the map name and mode nothing happens. Checked the upcoming map and it didn't change. Is it possibly deleting the map before it loads?

    Thanks!

    Edit: It displays:

    Usage: !setmap <mapname> <gamemode>
    and
    Example: !setmap MP_Prison conquest

    If you dont type anything after !setmap it will display that text

    Correct usage (for example): !setmap MP_Prison conquest


    Yes, it might be deleting before it loads completely. Change the codes to this:

    Code:
    On Say;Admin;Text !setmap;
        if %targettext% == 0; PlayerSay Usage: !setmap <mapname> <gamemode>;PlayerSay Example: !setmap MP_Prison conquest;end
        Exec mapList.add %targettext% 1 0
        Exec mapList.setNextMapIndex 0
        Set %ini_setmap_mapandmode% %targettext%
        PlayerSay You've set this map and mapmode: %targettext%
    
    On Spawn;ServerFirst;
        Set %currentmapandmode% %m% %mm%
        if %currentmapandmode% == %ini_setmap_mapandmode%; Exec mapList.remove 0
    Last edited by BuRockK; 28-10-2016 at 03:38.

  8. #8
    So I run it, and it says: "You've set this map and mapmode: ...". However, I type in nextmap and it is set to the first map in maplist, not the map I set. When you update the code, could you possibly make it where it also picks up where it left off in the maplist? So every time I set a custom map, is doesn't start it over? I really appreciate what you do man

    P.S. I also tried it with the actual names of maps, not the user friendly version (mode too), and it still doesn't list in nextmap. I'll let you know if it somehow ends up working though, once the next map is loaded.

  9. #9
    Ok I've tested it, and it successfully restarts the maplist, but doesn't set the next map as the one I set. So yeah :/

  10. #10
    try changing

    "Exec mapList.setNextMapIndex 0" part in the code

    to this: Exec mapList.setNextMapIndex 1

    i will test this once i get a small bf4 server soon. For now i cant be sure where the problem might be.

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •