[Code] Getting nextmap by custom way
#1
Rainbow 
Hey,

I just wrote code which will tell you next map!
You can replace GetServerCfg and split char to space if you want to use sv_maprotation var.

It will tell full map name. ( Not mp_dome or mp_alpha etc )

Oh, and remove unsafe if you don't need it.
Code:
public unsafe string GetNextMap() { ServerPrint("[KillMe V1.0] Getting nextmap..... "); string s = GetServerCFG("KillMe", "maprotation", null); string nextmap = string.Empty; String[] maps = s.Split(new Char[] { ',' }); for (int i = 0; i < maps.Length; i++) { // getting current map if (maps[i] == GetDvar("mapname")) { if (maps.Length >= i + 1) { nextmap = maps[1]; } else { nextmap = maps[i + 1]; } } } ServerPrint("[KillMe V1.0] Next map is " + nextmap); string sortedmapname = nextmap.Substring(3); // skip 'mp_' string mapname_prefix = "MPUI_"; // some maps if (sortedmapname == "alpha") { sortedmapname = "LOCKDOWN"; // we'll get MPUI_LOCKDOWN } string mapname = mapname_prefix + "" + sortedmapname.ToUpper(); return mapname; // Returns full map name }
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click



Possibly Related Threads…
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 18,415 10-29-2013, 07:22
Last Post: xInfinity.
  Help Code color crosshairs koren30 3 5,364 10-02-2013, 19:26
Last Post: koren30
  Help need help?how to make plugins code hXnarutoXone 12 12,023 09-01-2013, 18:30
Last Post: Bandarigoda123
  Custom xanims DidUknowiPwn 8 9,929 08-28-2013, 08:17
Last Post: RaZ
  Help Need Help with C# code tubwux 2 4,424 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 5,914 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 13,000 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 7,823 07-28-2013, 01:52
Last Post: First_Semyon
  Help Make ac130 shoot custom bullets Ra3shed 0 3,697 07-23-2013, 13:02
Last Post: Ra3shed
  [Tutorial] Custom gametype HUD iAegle 17 20,824 07-14-2013, 01:16
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.