- added sm_map
authorDavid Anderson <dvander@alliedmods.net>
Thu Jun 07 21:24:29 2007 +0000 (2007-06-07)
changeset 9172a9cf4e74620
parent 916 39ae94ad60ce
child 918 d498a233accf
- added sm_map
- moved some translations into a new file
plugins/basecommands.sp
translations/common.cfg
translations/core.cfg
     1.1 --- a/plugins/basecommands.sp	Thu Jun 07 18:50:52 2007 +0000
     1.2 +++ b/plugins/basecommands.sp	Thu Jun 07 21:24:29 2007 +0000
     1.3 @@ -35,8 +35,49 @@
     1.4  
     1.5  public OnPluginStart()
     1.6  {
     1.7 -	LoadTranslations("core.cfg");
     1.8 +	LoadTranslations("common.cfg");
     1.9  	RegAdminCmd("sm_kick", Command_Kick, ADMFLAG_KICK, "sm_kick <#userid|name> [reason]");
    1.10 +	RegAdminCmd("sm_map", Command_Map, ADMFLAG_CHANGEMAP, "sm_map <map>");
    1.11 +}
    1.12 +
    1.13 +public Action:Command_Map(client, args)
    1.14 +{
    1.15 +	if (args < 1)
    1.16 +	{
    1.17 +		ReplyToCommand(client, "[SM] Usage: sm_map <map>");
    1.18 +		return Plugin_Handled;
    1.19 +	}
    1.20 +	
    1.21 +	new String:map[64];
    1.22 +	GetCmdArg(1, map, sizeof(map));
    1.23 +	
    1.24 +	if (!IsMapValid(map))
    1.25 +	{
    1.26 +		ReplyToCommand(client, "[SM] %t", "Map was not found", map);
    1.27 +		return Plugin_Handled;
    1.28 +	}
    1.29 +	
    1.30 +	LogMessage("\"%L\" changed map to \"%s\"", client, map);
    1.31 +	ShowActivity(client, "%t", "Changing map", map);
    1.32 +	ReplyToCommand(client, "%t", "Changing map", map);
    1.33 +	
    1.34 +	new Handle:dp
    1.35 +	CreateDataTimer(3.0, Timer_ChangeMap, dp);
    1.36 +	WritePackString(dp, map);
    1.37 +	
    1.38 +	return Plugin_Handled;
    1.39 +}
    1.40 +
    1.41 +public Action:Timer_ChangeMap(Handle:timer, Handle:dp)
    1.42 +{
    1.43 +	new String:map[65];
    1.44 +	
    1.45 +	ResetPack(dp);
    1.46 +	ReadPackString(dp, map, sizeof(map));
    1.47 +	
    1.48 +	ServerCommand("changelevel \"%s\"", map);
    1.49 +	
    1.50 +	return Plugin_Stop;
    1.51  }
    1.52  
    1.53  public Action:Command_Kick(client, args)
    1.54 @@ -86,7 +127,7 @@
    1.55  		ServerCommand("kickid %d \"%s\"", userid, reason);
    1.56  	}
    1.57  	
    1.58 -	ReplyToCommand(client, "[SM] Client \"%s\" kicked.", name);
    1.59 +	ReplyToCommand(client, "[SM] %t", "Client kicked", name);
    1.60  	
    1.61  	return Plugin_Handled;
    1.62  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/translations/common.cfg	Thu Jun 07 21:24:29 2007 +0000
     2.3 @@ -0,0 +1,37 @@
     2.4 +"Phrases"
     2.5 +{
     2.6 +	"No matching client"
     2.7 +	{
     2.8 +		"en"			"No matching client was found."
     2.9 +	}
    2.10 +	
    2.11 +	"More than one client matches"
    2.12 +	{
    2.13 +		"#format"		"{1:s}"
    2.14 +		"en"			"More than one client matches the pattern '{1}'"
    2.15 +	}
    2.16 +	
    2.17 +	"Kicked player"
    2.18 +	{
    2.19 +		"#format"		"{1:s}"
    2.20 +		"en"			"Kicked player '{1}'"
    2.21 +	}
    2.22 +	
    2.23 +	"Client kicked"
    2.24 +	{
    2.25 +		"#format"		"{1:s}"
    2.26 +		"en"			"Client '{1}' kicked."
    2.27 +	}
    2.28 +	
    2.29 +	"Changing map"
    2.30 +	{
    2.31 +		"#format"		"{1:s}"
    2.32 +		"en"			"Changing map to {1}..."
    2.33 +	}
    2.34 +	
    2.35 +	"Map was not found"
    2.36 +	{
    2.37 +		"#format"		"{1:s}"
    2.38 +		"en"			"Map {1} was not found."
    2.39 +	}
    2.40 +}
     3.1 --- a/translations/core.cfg	Thu Jun 07 18:50:52 2007 +0000
     3.2 +++ b/translations/core.cfg	Thu Jun 07 21:24:29 2007 +0000
     3.3 @@ -20,23 +20,6 @@
     3.4  		"en"			"Exit"
     3.5  	}
     3.6  	
     3.7 -	"No matching client"
     3.8 -	{
     3.9 -		"en"			"No matching client was found."
    3.10 -	}
    3.11 -	
    3.12 -	"More than one client matches"
    3.13 -	{
    3.14 -		"#format"		"{1:s}"
    3.15 -		"en"			"More than one client matches the pattern '{1}'"
    3.16 -	}
    3.17 -	
    3.18 -	"Kicked player"
    3.19 -	{
    3.20 -		"#format"		"{1:s}"
    3.21 -		"en"			"Kicked player '{1}'"
    3.22 -	}
    3.23 -	
    3.24  	"Flooding the server"
    3.25  	{
    3.26  		"en"			"You are flooding the server!"