sm-plugins/mapchooser_extended/scripting/include/mapchooser_extended.inc

152 lines
4.4 KiB
PHP
Raw Normal View History

2016-01-19 23:57:32 +01:00
/**
* vim: set ts=4 :
* =============================================================================
* MapChooser Extended
* Creates a map vote at appropriate times, setting sm_nextmap to the winning
* vote
*
* MapChooser Extended (C)2011-2013 Powerlord (Ross Bemrose)
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
2016-01-19 23:57:32 +01:00
* 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/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _mapchooser_extended_included_
#endinput
#endif
#define _mapchooser_extended_included_
#include <mapchooser>
// MCE 1.9 series
enum CanNominateResult
{
CanNominate_No_VoteFull, /** No, nominations list is full */
CanNominate_No_VoteInProgress, /** No, map vote is in progress */
CanNominate_No_VoteComplete, /** No, map vote is completed */
CanNominate_Yes, /** Yes, you can nominate */
};
/**
* Called whenever warning timer starts
*
2016-01-19 23:57:32 +01:00
*/
2017-02-26 00:16:12 +01:00
forward void OnMapVoteWarningStart();
2016-01-19 23:57:32 +01:00
/**
* Called whenever runoff warning timer starts
*/
2017-02-26 00:16:12 +01:00
forward void OnMapVoteRunnoffWarningStart();
2016-01-19 23:57:32 +01:00
/**
* Called whenever the timer ticks
*/
2017-02-26 00:16:12 +01:00
forward void OnMapVoteWarningTick(int time);
2016-01-19 23:57:32 +01:00
/**
* Called whenever vote starts
*
2016-01-19 23:57:32 +01:00
* @deprecated Will be removed in MapChooser 1.8. Use OnMapVoteStarted instead.
*/
2017-02-26 00:16:12 +01:00
forward void OnMapVoteStart();
2016-01-19 23:57:32 +01:00
/**
* Called whenever vote ends
*/
2017-02-26 00:16:12 +01:00
forward void OnMapVoteEnd(const char[] map);
2016-01-19 23:57:32 +01:00
/**
* Is a map on the current game's official list?
* This should be treated as informative only.
*
2016-01-19 23:57:32 +01:00
* @param map Name of map to check
* @return true if it's on the list of official maps for this game
*/
native bool IsMapOfficial(const char[] map);
2016-01-19 23:57:32 +01:00
/**
* Is nominate allowed?
*
2016-01-19 23:57:32 +01:00
* @return A CanNominateResult corresponding to whether a vote is allowed or not
*/
native CanNominateResult CanNominate();
2016-01-19 23:57:32 +01:00
2016-12-05 18:50:44 +01:00
/**
* Add map to nomination exclude list.
* Known as cooldown.
*
2016-12-05 18:50:44 +01:00
* @param map Name of map
* @param cooldown Cooldown, interpretation depends on mode.
* @param mode 0: Normal, use cooldown value from config/default.
* 1: Set or replace cooldown with cooldown value.
* 2: Set or replace cooldown with cooldown value if greater than current cooldown.
* @return true on success
*/
native bool ExcludeMap(const char[] map, int cooldown = 0, int mode = 0);
2016-01-19 23:57:32 +01:00
native int GetMapCooldown(const char[] map);
native int GetMapMinTime(const char[] map);
native int GetMapMaxTime(const char[] map);
native int GetMapMinPlayers(const char[] map);
native int GetMapMaxPlayers(const char[] map);
// 0 = Okay
// >0 = Minutes till Okay
native int GetMapTimeRestriction(const char[] map);
// <0 = Less than MinPlayers
// 0 = Okay
// >0 = More than MaxPlayers
native int GetMapPlayerRestriction(const char[] map);
// <=0 = No group
// >0 = Groups found
native int GetMapGroups(const char[] map, int[] groups, int size);
// <0 = No restriction
// >=0 = Group _max -> Group full
native int GetMapGroupRestriction(const char[] map, int client = 0);
2018-09-23 23:53:59 +02:00
native bool GetMapVIPRestriction(const char[] map, int client = 0);
/**
* gives back the amount of extends left on a map
*
* #return amounts of extends left
*/
native int GetExtendsLeft();
public SharedPlugin __pl_mapchooser_extended =
2016-01-19 23:57:32 +01:00
{
name = "mapchooser",
file = "mapchooser_extended.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};