转自其他论坛CSGO服务器场名插件
本帖最后由 13diy 于 2013-2-18 23:49 编辑#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "CS:GO Chinese Host Name",
author = "k1nader",
description = "CS:GO Chinese Host Name",
version = "0.1",
url = "http://csmod.com"
};
public OnPluginStart()
RegServerCmd("sm_refresh_hostname", TReLoadHostName, "Refresh Host Name");
public OnMapStart()
ReLoadHostName();
public Action:TReLoadHostName(args)
ReLoadHostName();
public ReLoadHostName()
{
decl String:Path;
new iPort = GetConVarInt(FindConVar("hostport"));
BuildPath(Path_SM, Path, PLATFORM_MAX_PATH, "%d_hostname.txt", iPort);
decl String:HostName;
if(FileExists(Path, false))
{
new Handle:FileHandle = OpenFile(Path, "r");
ReadFileLine(FileHandle, HostName, sizeof(HostName));
CloseHandle(FileHandle);
}
else{
LogError("Cant find %s", Path);
HostName = "CS:GO 服务器";
}
new Handle:Convar = FindConVar("hostname");
SetConVarString(Convar, HostName, true, true);
}使用方法:
csgo\addons\sourcemod\端口_hostname.txt 写入服务器名称。(注意用UTF-8保存)
例子:
27015_hostname.txt 写入"CSGO 服务器[娱乐模式]" 即可 是中文服务器名吧? 阿登省奋斗vxxcv 学习学一学:victory: 场名插件????? 您所在的用户组无法下载或查看附件 感谢楼主分享 哈哈,这方面不太清楚,正好研究一下 感谢楼主分享 好家伙!!!
页:
[1]
2