Added native interface for Basecomm plugin (
bug 2594, r=fyren).
1 #if defined _mapchooser_included_
4 #define _mapchooser_included_
8 Nominate_Added, /** The map was added to the nominate list */
9 Nominate_Replaced, /** A clients existing nomination was replaced */
10 Nominate_AlreadyInVote, /** Specified map was already in the vote */
11 Nominate_InvalidMap, /** Mapname specifed wasn't a valid map */
12 Nominate_VoteFull, /** This will only occur if force was set to false */
17 MapChange_Instant, /** Change map as soon as the voting results have come in */
18 MapChange_RoundEnd, /** Change map at the end of the round */
19 MapChange_MapEnd, /** Change the sm_nextmap cvar */
23 * Attempt to add a map to the mapchooser map list.
25 * @param map Map to add.
26 * @param force Should we force the map in even if it requires overwriting an existing nomination?
27 * @param owner Client index of the nominater. If the client disconnects the nomination will be removed. Use 0 for constant nominations
28 * @return Nominate Result of the outcome
30 native NominateResult:NominateMap(const String:map[], bool:force, owner);
33 * Attempt to remove a map from the mapchooser map list.
35 * @param map Map to remove.
36 * @return True if the nomination was found and removed, or false if the nomination was not found.
38 native bool:RemoveNominationByMap(const String:map[]);
41 * Attempt to remove a map from the mapchooser map list.
43 * @param owner Client index of the nominater.
44 * @return True if the nomination was found and removed, or false if the nomination was not found.
46 native bool:RemoveNominationByOwner(owner);
49 * Gets the current list of excluded maps.
51 * @param array An ADT array handle to add the map strings to.
54 native GetExcludeMapList(Handle:array);
57 * Gets the current list of nominated maps.
59 * @param maparray An ADT array handle to add the map strings to.
60 * @param ownerarray An optional ADT array handle to add the nominator client indexes to.
63 native GetNominatedMapList(Handle:maparray, Handle:ownerarray = INVALID_HANDLE);
66 * Checks if MapChooser will allow a vote
68 * @return True if a vote can be held, or false if mapchooser is already holding a vote.
70 native bool:CanMapChooserStartVote();
73 * Initiates a MapChooser map vote
75 * Note: If no input array is specified mapchooser will use its internal list. This includes
76 * any nominations and excluded maps (as per mapchoosers convars).
78 * @param when MapChange consant of when the resulting mapchange should occur.
79 * @param inputarray ADT array list of maps to add to the vote.
81 native InitiateMapChooserVote(MapChange:when, Handle:inputarray=INVALID_HANDLE);
84 * Checks if MapChooser's end of map vote has completed.
86 * @return True if complete, false otherwise.
88 native bool:HasEndOfMapVoteFinished();
91 * Checks if MapChooser is set to run an end of map vote.
93 * @return True if enabled, false otherwise.
95 native bool:EndOfMapVoteEnabled();
98 * Called when mapchooser removes a nomination from its list.
99 * Nominations cleared on map start will not trigger this forward
101 forward OnNominationRemoved(const String:map[], owner);
104 * Called when mapchooser starts a Map Vote.
106 forward OnMapVoteStarted();
109 public SharedPlugin:__pl_mapchooser =
112 file = "mapchooser.smx",
113 #if defined REQUIRE_PLUGIN
120 public __pl_mapchooser_SetNTVOptional()
122 MarkNativeAsOptional("NominateMap");
123 MarkNativeAsOptional("RemoveNominationByMap");
124 MarkNativeAsOptional("RemoveNominationByOwner");
125 MarkNativeAsOptional("GetExcludeMapList");
126 MarkNativeAsOptional("GetNominatedMapList");
127 MarkNativeAsOptional("CanMapChooserStartVote");
128 MarkNativeAsOptional("InitiateMapChooserVote");
129 MarkNativeAsOptional("HasEndOfMapVoteFinished");
130 MarkNativeAsOptional("EndOfMapVoteEnabled");