pred@2133: #if defined _mapchooser_included_ pred@2133: #endinput pred@2133: #endif pred@2133: #define _mapchooser_included_ pred@2133: pred@2133: enum NominateResult pred@2133: { pred@2133: Nominate_Added, /** The map was added to the nominate list */ pred@2133: Nominate_Replaced, /** A clients existing nomination was replaced */ pred@2133: Nominate_AlreadyInVote, /** Specified map was already in the vote */ pred@2133: Nominate_InvalidMap, /** Mapname specifed wasn't a valid map */ pred@2133: Nominate_VoteFull, /** This will only occur if force was set to false */ pred@2133: }; pred@2133: pred@2133: enum MapChange pred@2133: { pred@2133: MapChange_Instant, /** Change map as soon as the voting results have come in */ pred@2133: MapChange_RoundEnd, /** Change map at the end of the round */ pred@2133: MapChange_MapEnd, /** Change the sm_nextmap cvar */ pred@2133: }; pred@2133: pred@2133: /** pred@2133: * Attempt to add a map to the mapchooser map list. pred@2133: * pred@2133: * @param map Map to add. pred@2133: * @param force Should we force the map in even if it requires overwriting an existing nomination? pred@2133: * @param owner Client index of the nominater. If the client disconnects the nomination will be removed. Use 0 for constant nominations pred@2133: * @return Nominate Result of the outcome pred@2133: */ pred@2133: native NominateResult:NominateMap(const String:map[], bool:force, owner); pred@2133: pred@2133: /** pred@2133: * Gets the current list of excluded maps. pred@2133: * pred@2133: * @param array An ADT array handle to add the map strings to. Needs to be pred@2133: * @noreturn pred@2133: */ pred@2133: native GetExcludeMapList(Handle:array); pred@2133: pred@2133: /** pred@2133: * Checks if MapChooser will allow a vote pred@2133: * pred@2133: * @return True if a vote can be held, or false if mapchooser is already holding a vote. pred@2133: */ pred@2133: native bool:CanMapChooserStartVote(); pred@2133: pred@2133: /** pred@2133: * Initiates a MapChooser map vote pred@2133: * pred@2133: * Note: If no input array is specified mapchooser will use its internal list. This includes pred@2133: * any nominations and excluded maps (as per mapchoosers convars). pred@2133: * pred@2133: * @param when MapChange consant of when the resulting mapchange should occur. pred@2133: * @param inputarray ADT array list of maps to add to the vote. pred@2133: */ pred@2133: native InitiateMapChooserVote(MapChange:when, Handle:inputarray=INVALID_HANDLE); pred@2133: pred@2133: /** pred@2212: * Checks if MapChooser's end of map vote has completed. pred@2223: * pred@2223: * @return True if complete, false otherwise. pred@2133: */ pred@2133: native bool:HasEndOfMapVoteFinished(); pred@2133: pred@2133: /** pred@2223: * Checks if MapChooser is set to run an end of map vote. pred@2223: * pred@2223: * @return True if enabled, false otherwise. pred@2223: */ pred@2223: native bool:EndOfMapVoteEnabled(); pred@2223: pred@2223: /** pred@2133: * Called when mapchooser removes a nomination from its list. pred@2133: * Nominations cleared on map start will not trigger this forward pred@2133: */ pred@2350: forward OnNominationRemoved(const String:map[], owner); pred@2133: pred@2133: pred@2133: public SharedPlugin:__pl_mapchooser = pred@2133: { pred@2133: name = "mapchooser", pred@2133: file = "mapchooser.smx", pred@2133: #if defined REQUIRE_PLUGIN pred@2133: required = 1, pred@2133: #else pred@2133: required = 0, pred@2133: #endif pred@2212: }; pred@2212: pred@2212: public __pl_mapchooser_SetNTVOptional() pred@2212: { pred@2212: MarkNativeAsOptional("NominateMap"); pred@2212: MarkNativeAsOptional("GetExcludeMapList"); pred@2212: MarkNativeAsOptional("CanMapChooserStartVote"); pred@2212: MarkNativeAsOptional("InitiateMapChooserVote"); pred@2212: MarkNativeAsOptional("HasEndOfMapVoteFinished"); dvander@2229: MarkNativeAsOptional("EndOfMapVoteEnabled"); dvander@2229: } dvander@2229: