Add missing MarkNativeAsOptional calls for cstrike.inc (r=me).
3 * =============================================================================
4 * SourceMod (C)2004-2011 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _sdktools_gamerules_included
36 #define _sdktools_gamerules_included
39 // initialize the game, create teams
42 //Before players have joined the game. Periodically checks to see if enough players are ready
43 //to start a game. Also reverts to this when there are no active players
46 //The game is about to start, wait a bit and spawn everyone
49 //All players are respawned, frozen in place
52 //Round is on, playing normally
53 RoundState_RoundRunning,
55 //Someone has won the round
58 //Noone has won, manually restart the game, reset scores
61 //Noone has won, restart the game
64 //Game is over, showing the scoreboard etc
67 //Game is over, doing bonus round stuff
71 RoundState_BetweenRounds,
75 * Retrieves an integer value from a property of the gamerules entity.
77 * @param prop Property name.
78 * @param size Number of bytes to read (valid values are 1, 2, or 4).
79 * This value is auto-detected, and the size parameter is
80 * only used as a fallback in case detection fails.
81 * @param element Element # (starting from 0) if property is an array.
82 * @return Value at the given property offset.
83 * @error Not supported.
85 native GameRules_GetProp(const String:prop[], size=4, element=0);
88 * Sets an integer value for a property of the gamerules entity.
90 * @param prop Property name.
91 * @param value Value to set.
92 * @param size Number of bytes to write (valid values are 1, 2, or 4).
93 * This value is auto-detected, and the size parameter is
94 * only used as a fallback in case detection fails.
95 * @param element Element # (starting from 0) if property is an array.
96 * @param changeState If true, change will be sent over the network.
97 * @error Not supported.
100 native GameRules_SetProp(const String:prop[], any:value, size=4, element=0, bool:changeState=false);
103 * Retrieves a float value from a property of the gamerules entity.
105 * @param prop Property name.
106 * @param element Element # (starting from 0) if property is an array.
107 * @return Value at the given property offset.
108 * @error Not supported.
110 native Float:GameRules_GetPropFloat(const String:prop[], element=0);
113 * Sets a float value for a property of the gamerules entity.
115 * @param prop Property name.
116 * @param value Value to set.
117 * @param element Element # (starting from 0) if property is an array.
118 * @param changeState If true, change will be sent over the network.
120 * @error Not supported.
122 native GameRules_SetPropFloat(const String:prop[], Float:value, element=0, bool:changeState=false);
125 * Retrieves a entity index from a property of the gamerules entity.
127 * @param prop Property name.
128 * @param element Element # (starting from 0) if property is an array.
129 * @return Entity index at the given property.
130 * If there is no entity, or the entity is not valid,
131 * then -1 is returned.
132 * @error Not supported.
134 native GameRules_GetPropEnt(const String:prop[], element=0);
137 * Sets an entity index for a property of the gamerules entity.
139 * @param prop Property name.
140 * @param other Entity index to set, or -1 to unset.
141 * @param element Element # (starting from 0) if property is an array.
142 * @param changeState If true, change will be sent over the network.
144 * @error Not supported.
146 native GameRules_SetPropEnt(const String:prop[], other, element=0, bool:changeState=false);
149 * Retrieves a vector of floats from the gamerules entity, given a named network property.
151 * @param prop Property name.
152 * @param vec Vector buffer to store data in.
153 * @param element Element # (starting from 0) if property is an array.
155 * @error Not supported.
157 native GameRules_GetPropVector(const String:prop[], Float:vec[3], element=0);
160 * Sets a vector of floats in the gamerules entity, given a named network property.
162 * @param prop Property name.
163 * @param vec Vector to set.
164 * @param element Element # (starting from 0) if property is an array.
165 * @param changeState If true, change will be sent over the network.
167 * @error Not supported.
169 native GameRules_SetPropVector(const String:prop[], const Float:vec[3], element=0, bool:changeState=false);
172 * Gets a gamerules property as a string.
174 * @param prop Property to use.
175 * @param buffer Destination string buffer.
176 * @param maxlen Maximum length of output string buffer.
177 * @return Number of non-null bytes written.
178 * @error Not supported.
180 native GameRules_GetPropString(const String:prop[], String:buffer[], maxlen);
183 * Sets a gamerules property as a string.
185 * @param prop Property to use.
186 * @param buffer String to set.
187 * @param changeState If true, change will be sent over the network.
188 * @return Number of non-null bytes written.
189 * @error Not supported.
191 native GameRules_SetPropString(const String:prop[], const String:buffer[], bool:changeState=false);
194 * Gets the current round state.
196 * @return Round state.
197 * @error Game doesn't support round state.
199 stock RoundState:GameRules_GetRoundState()
201 return RoundState:GameRules_GetProp("m_iRoundState");