- added sm_map
- moved some translations into a new file --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40923
This commit is contained in:
parent
be6335c91a
commit
9da7a82af8
@ -35,8 +35,49 @@ public Plugin:myinfo =
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
LoadTranslations("core.cfg");
|
||||
LoadTranslations("common.cfg");
|
||||
RegAdminCmd("sm_kick", Command_Kick, ADMFLAG_KICK, "sm_kick <#userid|name> [reason]");
|
||||
RegAdminCmd("sm_map", Command_Map, ADMFLAG_CHANGEMAP, "sm_map <map>");
|
||||
}
|
||||
|
||||
public Action:Command_Map(client, args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
ReplyToCommand(client, "[SM] Usage: sm_map <map>");
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
new String:map[64];
|
||||
GetCmdArg(1, map, sizeof(map));
|
||||
|
||||
if (!IsMapValid(map))
|
||||
{
|
||||
ReplyToCommand(client, "[SM] %t", "Map was not found", map);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
LogMessage("\"%L\" changed map to \"%s\"", client, map);
|
||||
ShowActivity(client, "%t", "Changing map", map);
|
||||
ReplyToCommand(client, "%t", "Changing map", map);
|
||||
|
||||
new Handle:dp
|
||||
CreateDataTimer(3.0, Timer_ChangeMap, dp);
|
||||
WritePackString(dp, map);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public Action:Timer_ChangeMap(Handle:timer, Handle:dp)
|
||||
{
|
||||
new String:map[65];
|
||||
|
||||
ResetPack(dp);
|
||||
ReadPackString(dp, map, sizeof(map));
|
||||
|
||||
ServerCommand("changelevel \"%s\"", map);
|
||||
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
public Action:Command_Kick(client, args)
|
||||
@ -86,7 +127,7 @@ public Action:Command_Kick(client, args)
|
||||
ServerCommand("kickid %d \"%s\"", userid, reason);
|
||||
}
|
||||
|
||||
ReplyToCommand(client, "[SM] Client \"%s\" kicked.", name);
|
||||
ReplyToCommand(client, "[SM] %t", "Client kicked", name);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
37
translations/common.cfg
Normal file
37
translations/common.cfg
Normal file
@ -0,0 +1,37 @@
|
||||
"Phrases"
|
||||
{
|
||||
"No matching client"
|
||||
{
|
||||
"en" "No matching client was found."
|
||||
}
|
||||
|
||||
"More than one client matches"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "More than one client matches the pattern '{1}'"
|
||||
}
|
||||
|
||||
"Kicked player"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Kicked player '{1}'"
|
||||
}
|
||||
|
||||
"Client kicked"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Client '{1}' kicked."
|
||||
}
|
||||
|
||||
"Changing map"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Changing map to {1}..."
|
||||
}
|
||||
|
||||
"Map was not found"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Map {1} was not found."
|
||||
}
|
||||
}
|
@ -20,23 +20,6 @@
|
||||
"en" "Exit"
|
||||
}
|
||||
|
||||
"No matching client"
|
||||
{
|
||||
"en" "No matching client was found."
|
||||
}
|
||||
|
||||
"More than one client matches"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "More than one client matches the pattern '{1}'"
|
||||
}
|
||||
|
||||
"Kicked player"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Kicked player '{1}'"
|
||||
}
|
||||
|
||||
"Flooding the server"
|
||||
{
|
||||
"en" "You are flooding the server!"
|
||||
|
Loading…
Reference in New Issue
Block a user