1 Star 0 Fork 0

NayoAyo/Zombie-Plague

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
zbm3_gamemode_plague.sp 3.11 KB
一键复制 编辑 原始数据 按行查看 历史
Nikita Ushakov 提交于 2018-10-16 04:15 . 8.4.0
/**
* ============================================================================
*
* Zombie Plague Mod #3 Generation
*
*
* Copyright (C) 2015-2018 Nikita Ushakov (Ireland, Dublin)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ============================================================================
**/
#include <sourcemod>
#include <sdktools>
#include <zombieplague>
#pragma newdecls required
/**
* Record plugin info.
**/
public Plugin myinfo =
{
name = "[ZP] Game Mode: Plague",
author = "qubka (Nikita Ushakov)",
description = "Addon of game modes",
version = "1.0",
url = "https://forums.alliedmods.net/showthread.php?t=290657"
}
/**
* @section Information about human class.
**/
#define GAME_MODE_NAME "plague"
#define GAME_MODE_DESCRIPTION "plague swarm" // String has taken from translation file
#define GAME_MODE_SOUND "ROUND_PLAGUE_SOUNDS" // Sounds has taken from sounds file
#define GAME_MODE_CHANCE 20 // If value has 0, mode will be taken like a default
#define GAME_MODE_MIN_PLAYERS 0
#define GAME_MODE_RATIO 0.5
#define GAME_MODE_INFECTION false
#define GAME_MODE_RESPAWN false
#define GAME_MODE_SURVIVOR false
#define GAME_MODE_NEMESIS false
/**
* @endsection
**/
// Mode index
int gPlague;
#pragma unused gPlague
/**
* Called after a library is added that the current plugin references optionally.
* A library is either a plugin name or extension name, as exposed via its include file.
**/
public void OnLibraryAdded(const char[] sLibrary)
{
// Validate library
if(!strcmp(sLibrary, "zombieplague", false))
{
// Initialize game mode
gPlague = ZP_RegisterGameMode(GAME_MODE_NAME,
GAME_MODE_DESCRIPTION,
GAME_MODE_SOUND,
GAME_MODE_CHANCE,
GAME_MODE_MIN_PLAYERS,
GAME_MODE_RATIO,
GAME_MODE_INFECTION,
GAME_MODE_RESPAWN,
GAME_MODE_SURVIVOR,
GAME_MODE_NEMESIS);
}
}
/**
* Called after a zombie round is started.
**/
public void ZP_OnZombieModStarted(int modeIndex)
{
// Validate plague mode
if(modeIndex == gPlague) /* OR if(ZP_GetCurrentGameMode() == ZP_GetServerGameMode(GAME_MODE_NAME))*/
{
// Make a random nemesis/survivor
ZP_SwitchClientClass(ZP_GetRandomHuman(), _, TYPE_NEMESIS);
ZP_SwitchClientClass(ZP_GetRandomZombie(), _, TYPE_SURVIVOR);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ysllll/Zombie-Plague.git
git@gitee.com:ysllll/Zombie-Plague.git
ysllll
Zombie-Plague
Zombie-Plague
master

搜索帮助