5 #if defined _sourcemod_included
8 #define _sourcemod_included
12 const String:name[], /* Plugin Name */
13 const String:description[], /* Plugin Description */
14 const String:author[], /* Plugin Author */
15 const String:version[], /* Plugin Version */
16 const String:url[], /* Plugin URL */
25 * Declare this as a struct in your plugin to expose its information.
28 * public Plugin:myinfo =
37 * Called when the plugin is fully initialized and all known external references are resolved.
38 * This is called even if the plugin type is "private."
39 * NOTE: Errors in this function will cause the plugin to stop running.
43 forward OnPluginInit(Handle:myself);
46 * Called before OnPluginInit, in case the plugin wants to check for load failure.
47 * This is called even if the plugin type is "private." Any natives from modules are
48 * not available at this point. Thus, this forward should only be used for explicit
49 * pre-emptive things, such as adding dynamic natives, or setting certain types of load filters.
51 * NOTE: It is not safe to call externally resolved natives until OnPluginInit().
52 * NOTE: Any sort of RTE in this function will cause the plugin to fail loading.
54 * @param myself Handle to the plugin.
55 * @param late Whether or not the plugin was loaded "late" (after map load).
56 * @param error Error message buffer in case load failed.
57 * @param err_max Maximum number of characters for error message buffer.
58 * @return True if load success, false otherwise.
60 forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
63 * Called when the plugin is about to be unloaded.
67 forward OnPluginUnload();
70 * Called when the plugin's pause status is changing.
74 forward OnPluginPauseChange(bool:pause);
77 * Called on client connection.
79 * @param client Player index.
80 * @param rejectmsg Buffer to store the rejection message when the connection is refused.
81 * @param maxlen Maximum number of characters for rejection buffer.
82 * @return True to validate client's connection, false to refuse it.
84 forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
87 * Called when a client is entering to the game.
89 * @param client Player index.
92 forward OnClientPutInServer(client);
95 * Called when a client is disconnecting from the server.
97 * @param client Player index.
100 forward OnClientDisconnect(client);
103 * Called when a client is disconnected from the server.
105 * @param client Player index.
108 forward OnClientDisconnect_Post(client);
111 * Called when a client is sending a command.
113 * @param client Player index.
116 forward OnClientCommand(client);
119 * Called whenever the client's settings are changed.
121 * @param client Player index.
124 forward OnClientSettingsChanged(client);
127 * Returns the maximum number of clients allowed on the server.
129 * @return Maximum number of clients allowed.
131 native GetMaxClients();
134 * Returns the client count put in the server.
136 * @param inGameOnly If false connecting players are also counted.
137 * @return Client count in the server.
139 native GetClientCount(bool:inGameOnly=true);
142 * Returns the client's name.
144 * @param client Player index.
145 * @param name Buffer to store the client's name.
146 * @param maxlen Maximum length of string buffer (includes NULL terminator).
147 * @return True on success, false otherwise.
148 * @error If the client is not connected an error will be thrown.
150 native bool:GetClientName(client, String:name[], maxlen);
153 * Retrieves a client's IP address.
155 * @param client Player index.
156 * @param name Buffer to store the client's ip address.
157 * @param maxlen Maximum length of string buffer (includes NULL terminator).
158 * @param remport Remove client's port from the ip string (true by default).
159 * @return True on success, false otherwise.
160 * @error If the client is not connected an error will be thrown.
162 native bool:GetClientIP(client, String:ip[], maxlen, bool:remport=true);
165 * Retrieves a client's authentication string (SteamID).
167 * @param client Player index.
168 * @param auth Buffer to store the client's auth string.
169 * @param maxlen Maximum length of string buffer (includes NULL terminator).
170 * @return True on success, false otherwise.
171 * @error If the client is not connected an error will be thrown.
173 native bool:GetClientAuthString(client, String:auth[], maxlen);
176 * Returns if a certain player is connected.
178 * @param client Player index.
179 * @return True if player is connected to the server, false otherwise.
181 native bool:IsPlayerConnected(client);
184 * Returns if a certain player has entered the game.
186 * @param client Player index.
187 * @return True if player has entered the game, false otherwise.
189 native bool:IsPlayerInGame(client);
192 * Returns if a certain player has been authenticated.
194 * @param client Player index.
195 * @return True if player has been authenticated, false otherwise.
197 native bool:IsPlayerAuthorized(client);
200 * Returns if a certain player is a fake client.
202 * @param client Player index.
203 * @return True if player is a fake client, false otherwise.
205 native bool:IsPlayerFakeClient(client);
208 * Sends a message to the server console.
210 * @param format Formatting rules.
211 * @param ... Variable number of format parameters.
214 native PrintToServer(const String:format[], {Handle,Float,String,_}:...);
217 * Sends a message to a client's console.
219 * @param client Player index.
220 * @param format Formatting rules.
221 * @param ... Variable number of format parameters.
223 * @error If the client is not connected an error will be thrown.
225 native PrintToConsole(client, const String:format[], {Handle,Float,String,_}:...);