Map & Game Type Changer by Sa3id
The best plugin for change game type and map (Together)
Source code uploaded
CMDs
Spoiler (Click to View)
!gametype <mapname> <dsrname> - ex : !gametype mp_dome sd
!map<mapname> - change map - ex : !mapdome
!mod <dsrname> - change gametype with current map - ex : !mod sd
!map<mapname> - change map - ex : !mapdome
!mod <dsrname> - change gametype with current map - ex : !mod sd
Source Code:
Spoiler (Click to View)
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;
using System.Threading;
using System.IO;
namespace Sa3idMapper
{
class CommandClass : CPlugin
{
public CommandClass()
{
}
public Boolean execCommand(String Message, ServerClient issuer)
{
Char[] delimit = { ' ' };
String[] split = Message.Split(delimit);
if (split[0] == null)
{
return true;
}
split = Message.Split(' ');
if (split[0] == "!gametype")
{
if (split.Length > 2)
{
if (split[1] == "")
{
TellClient(issuer.ClientNum, "^2Enter a map name", true);
}
if (split[2] == "")
{
TellClient(issuer.ClientNum, "^2Enter a dsr name", true);
}
if (File.Exists(@"admin\" + split[2] + ".dsr") && File.Exists(@"zone\english\" + split[1] + ".ff") || File.Exists(@"admin\" + split[2] + ".dsr") && File.Exists(@"zone\dlc\" + split[1] + ".ff"))
{
File.Delete(@"admin\sa3id.dspl");
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"admin\sa3id.dspl", true))
{
ServerSay("^2Gametype Changed : ^3" + split[2] + " ^2Map : ^3" + split[1], true);
file.WriteLine(split[1] + "," + split[2] + ",1");
ServerCommand("sv_maprotation sa3id");
ServerCommand("start_map_rotate Default");
}
}
else
{
TellClient(issuer.ClientNum, "^1could'nt find the map or dsr", true);
}
}
}
else if (split[0].Equals("!mod"))
{
if (split.Length > 1)
{
if (split[1] == "")
{
TellClient(issuer.ClientNum, "^2Type a dsr name", true);
}
if (File.Exists(@"admin\" + split[1] + ".dsr"))
{
File.Delete(@"admin\sa3id.dspl");
string cmap;
cmap = GetDvar("mapname");
cmap.Replace("default:", "");
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"admin\sa3id.dspl", true))
{
ServerSay("^2GameType Changed to : ^3" + split[1], true);
file.WriteLine(cmap + "," + split[1] + ",1");
ServerCommand("sv_maprotation sa3id");
ServerCommand("start_map_rotate Default");
}
}
else
{
TellClient(issuer.ClientNum, "^1could'nt find the dsr", true);
}
}
}
else if (split[0] == "!mapdome")
{
ServerCommand("map mp_dome");
}
else if (split[0] == ("!maplockdown"))
{
ServerCommand("map mp_alpha");
}
else if (split[0] == ("!mapbootleg"))
{
ServerCommand("map mp_bootleg");
}
else if (split[0] == ("!mapmission"))
{
ServerCommand("map mp_bravo");
}
else if (split[0] == ("!mapcarbon"))
{
ServerCommand("map mp_carbon");
}
else if (split[0] == ("!mapdownturn"))
{
ServerCommand("map mp_exchange");
}
else if (split[0] == ("!maphardhat"))
{
ServerCommand("map mp_hardhat");
}
else if (split[0] == ("!mapinterchange"))
{
ServerCommand("map mp_interchange");
}
else if (split[0] == ("!mapfallen"))
{
ServerCommand("map mp_lambeth");
}
else if (split[0] == ("!mapbakaraa"))
{
ServerCommand("map mp_mogadishu");
}
else if (split[0] == ("!mapresistance"))
{
ServerCommand("map mp_paris");
}
else if (split[0] == ("!maparkaden"))
{
ServerCommand("map mp_plaza2");
}
else if (split[0] == ("!mapoutpost"))
{
ServerCommand("map mp_radar");
}
else if (split[0] == ("!mapseatown"))
{
ServerCommand("map mp_seatown");
}
else if (split[0] == ("!mapunderground"))
{
ServerCommand("map mp_underground");
}
else if (split[0] == ("!mapvillage"))
{
ServerCommand("map mp_village");
}
else if (split[0] == ("!mapterminal"))
{
ServerCommand("map mp_terminal_cls");
}
else if (split[0] == ("!mapoverwatch"))
{
ServerCommand("map mp_overwatch");
}
else if (split[0] == ("!mapliberation"))
{
ServerCommand("map mp_park");
}
else if (split[0] == ("!mappiazza"))
{
ServerCommand("map mp_italy");
}
else if (split[0] == ("!mapblackbox"))
{
ServerCommand("map mp_morningwood");
}
else if (split[0] == ("!mapsanctuary"))
{
ServerCommand("map mp_meteora");
}
else if (split[0] == ("!mapfoundation"))
{
ServerCommand("map mp_cement");
}
else if (split[0] == ("!mapoasis"))
{
ServerCommand("map mp_qadeem");
}
else if (split[0] == ("!mapaground"))
{
ServerCommand("map mp_aground_ss");
}
else if (split[0] == ("!maperosion"))
{
ServerCommand("map mp_courtyard_ss");
}
else if (split[0] == ("!mapgetaway"))
{
ServerCommand("map mp_hillside_ss");
}
else if (split[0] == ("!maplookout"))
{
ServerCommand("map mp_restrepo_ss");
}
else if (split[0] == ("!maputurn"))
{
ServerCommand("map mp_burn_ss");
}
else if (split[0] == ("!mapintersection"))
{
ServerCommand("map mp_crosswalk_ss");
}
else if (split[0] == ("!mapvortex"))
{
ServerCommand("map mp_six_ss");
}
else if (split[0] == ("!mapdecommission"))
{
ServerCommand("map mp_shipbreaker");
}
else if (split[0] == ("!mapoffshore"))
{
ServerCommand("map mp_roughneck");
}
else if (split[0] == ("!mapgulch"))
{
ServerCommand("map mp_moab");
}
else if (split[0] == ("!mapboardwalk"))
{
ServerCommand("map mp_boardwalk");
}
else if (split[0] == ("!mapparish"))
{
ServerCommand("map mp_nola");
}
return true;
}
}
}
CREDITS:
BoneMind Making Initial Plugin
Requirements :
MW3 Server Addon
Fixed
Sa3id Map , Gametype Changer Plugin.zip (Size: 3.63 KB / Downloads: 459)
Source (Server Admin)
Map and gametype changer (server admin source).zip (Size: 1.48 MB / Downloads: 390)