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 */
24 * Declare this as a struct in your plugin to expose its information.
27 * public Plugin:myinfo =
36 * Called when the plugin is fully initialized and all known external references are resolved.
37 * This is called even if the plugin type is "private."
38 * NOTE: Errors in this function will cause the plugin to stop running.
42 forward OnPluginInit(Handle:myself);
45 * Called before OnPluginInit, in case the plugin wants to check for load failure.
46 * This is called even if the plugin type is "private." Any natives from modules are
47 * not available at this point. Thus, this forward should only be used for explicit
48 * pre-emptive things, such as adding dynamic natives, or setting certain types of load filters.
50 * NOTE: It is not safe to call externally resolved natives until OnPluginInit().
51 * NOTE: Any sort of RTE in this function will cause the plugin to fail loading.
53 * @param myself Handle to the plugin.
54 * @param late Whether or not the plugin was loaded "late" (after map load).
55 * @param error Error message buffer in case load failed.
56 * @param err_max Maximum number of characters for error message buffer.
57 * @return True if load success, false otherwise.
59 forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
62 * Called when the plugin is about to be unloaded.
66 forward OnPluginUnload();
69 * Called when the plugin's pause status is changing.
73 forward OnPluginPauseChange(bool:pause);
76 * Called on client connection.
78 * @param client Player index.
79 * @param rejectmsg Buffer to store the rejection message when the connection is refused.
80 * @param maxlen Maximum number of characters for rejection buffer.
81 * @return True to validate client's connection, false to refuse it.
83 forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
86 * Called when a client is entering to the game.
88 * @param client Player index.
91 forward OnClientPutInServer(client);
94 * Called when a client is disconnecting from the server.
96 * @param client Player index.
99 forward OnClientDisconnect(client);
102 * Called when a client is disconnected from the server.
104 * @param client Player index.
107 forward OnClientDisconnect_Post(client);
110 * Called when a client is sending a command.
112 * @param client Player index.
115 forward OnClientCommand(client);
118 * Called whenever the client's settings are changed.
120 * @param client Player index.
123 forward OnClientSettingsChanged(client);
126 * Returns the maximum number of clients allowed on the server.
128 * @return Maximum number of clients allowed.
130 native GetMaxClients();
133 * Returns the client count put in the server.
135 * @param inGameOnly If false connecting players are also counted.
136 * @return Client count in the server.
138 native GetClientCount(bool:inGameOnly=true);
141 * Returns the client's name.
143 * @param client Player index.
144 * @param name Buffer to store the client's name.
145 * @param maxlen Maximum length of string buffer (includes NULL terminator).
148 native GetClientName(client, String:name[], maxlen);
151 * Retrieves a client's IP address.
153 * @param client Player index.
154 * @param name Buffer to store the client's ip address.
155 * @param maxlen Maximum length of string buffer (includes NULL terminator).
158 native GetClientIP(client, String:ip[], maxlen);
161 * Retrieves a client's authentication string (SteamID).
163 * @param client Player index.
164 * @param auth Buffer to store the client's auth string.
165 * @param maxlen Maximum length of string buffer (includes NULL terminator).
166 * @return Returns 0 on failure, non-zero otherwise.
168 native GetClientAuthString(client, String:auth[], maxlen);
171 * Returns if a certain player is connected.
173 * @param client Player index.
174 * @return True if player is connected to the server, false otherwise.
176 native bool:IsPlayerConnected(client);
179 * Returns if a certain player has entered the game.
181 * @param client Player index.
182 * @return True if player has entered the game, false otherwise.
184 native bool:IsPlayerInGame(client);
187 * Returns if a certain player has been authenticated.
189 * @param client Player index.
190 * @return True if player has been authenticated, false otherwise.
192 native bool:IsPlayerAuthorized(client);
195 * Returns if a certain player is a fake client.
197 * @param client Player index.
198 * @return True if player is a fake client, false otherwise.
200 native bool:IsPlayerFakeClient(client);