Events::Player::OnPlayerConnected.Hook( @OnPlayerConnected ); //玩家已进入服务器
Events::Player::OnPlayerSpawn.Hook( @OnPlayerSpawn ); //当玩家人物被创建
Events::Player::OnPlayerDamaged.Hook( @OnPlayerDamaged ); //当玩家受到伤害
Events::Player::PlayerSay.Hook( @OnPlayerSay ); //玩家聊天框被使用
Events::Infected::OnInfectedKilled.Hook( @OnInfectedKilled ); //当感染者死亡
用法说明:当玩家已经进入(不是连接中)服务器时,触发指令,这里用欢迎信息来显示
// 聊天框信息输出 all=全体人员 {purple}颜色代码 pBasePlayer=pPlayer
HookReturnCode OnPlayerConnected(CTerrorPlayer@ pPlayer)
{
CBasePlayer@ pBasePlayer = pPlayer.opCast();
Chat.PrintToChat( all, "{purple}[紫冰] {white}欢迎 {azure}"+ pPlayer.GetPlayerName() +" {white}加入{green}紫冰专属服务器." );
Chat.PrintToChat(pBasePlayer, "{purple}[紫冰] {white}QQ群: {green}208327622");
return HOOK_CONTINUE;
}
用法说明:玩家选择人物进入游戏后,系统会提示下面信息
//玩家出生
HookReturnCode OnPlayerSpawn(CTerrorPlayer@ pPlayer)
{
Chat.PrintToChat( all, "{purple}[紫冰] {azure}"+ pPlayer.GetPlayerName() +" {white}被创建出来了." );
return HOOK_CONTINUE;
}
用法说明:当玩家被攻击受伤时,系统提示信息
//玩家受到伤害
HookReturnCode OnPlayerDamaged(CTerrorPlayer@ pPlayer, CTakeDamageInfo &in DamageInfo)
{
CBaseEntity @pEntityPlayer = ToBaseEntity( pPlayer ); //实体转换
int iHealthMax = pEntityPlayer.GetMaxHealth();
int iHealth = pEntityPlayer.GetHealth();
pEntityPlayer.SetHealth( Math::clamp( iHealth, 0, iHealthMax ) );
Chat.PrintToChat( pPlayer, "{purple}[紫冰] {azure}"+pPlayer.GetPlayerName() +"{white}当前剩余血量:{green}"+ pEntityPlayer.GetHealth()+"{white}/"+ iHealthMax);
return HOOK_CONTINUE;
}
本模式灵感来源生化危机的豆腐模式.
- 模式只有近战武器
- 噩梦难度下丧尸伤害约20HP.
- 游戏指令:!hp查看自己当前血量.
▶ 模式开启方法:
1.控制台输入exec doufu
2.投票重新开始当前回合.
Hardcore mode with only melee weapons
How to open the mode.
未完待续,正在自行摸索学习中