万事开头难。
插件只是非常简单地实现在聊天框输出进入服务器的玩家名字PlayerName
效果
源码
smx的源码是.sp
后缀
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
public void OnPluginStart()
{
PrintToServer("插件加载了");
}
public void OnClientPutInServer(int client)
{
PrintToChatAll("%s 进入游戏", GetTrueName(client));
}
//返回对应的内容.
char[] GetTrueName(int client)
{
char sName[32];
GetClientName(client, sName, sizeof(sName));
return sName;
}
编译
源码的编译器L4D2提供了,在本地目录..\left4dead2\addons\sourcemod\scripting
下
将编写好的.sp
文件拖到complie.exe
上即可。
编译成功自动生成complied
文件夹放入编译好的.smx
文件。
插件使用
使用插件需要安装前置平台,比如豆瓣酱的战役整合包,以提供插件运行环境。
将smx
文件放入..\left4dead2\addons\sourcemod\plugins
中运行游戏即可。
wl
05 / 07用上了!谢!
From Nginx Proxy Manager 登录出错 Bad gateway