dvander@165: /** dvander@165: * :TODO: license info dvander@165: */ dvander@165: dvander@165: #if defined _sourcemod_included dvander@165: #endinput dvander@165: #endif dvander@165: #define _sourcemod_included dvander@165: dvander@170: struct Plugin dvander@170: { dvander@170: const String:name[], /* Plugin Name */ dvander@170: const String:description[], /* Plugin Description */ dvander@170: const String:author[], /* Plugin Author */ dvander@170: const String:version[], /* Plugin Version */ dvander@170: const String:url[], /* Plugin URL */ faluco@242: }; dvander@170: dvander@252: #include dvander@252: #include dvander@252: #include dvander@257: #include dvander@252: dvander@165: /** dvander@170: * Declare this as a struct in your plugin to expose its information. dvander@170: * Example: dvander@170: * dvander@170: * public Plugin:myinfo = dvander@170: * { dvander@170: * name = "My Plugin", dvander@170: * //etc dvander@170: * }; dvander@165: */ dvander@170: public Plugin:myinfo; dvander@165: dvander@165: /** dvander@212: * Called when the plugin is fully initialized and all known external references are resolved. dvander@212: * This is called even if the plugin type is "private." dvander@212: * NOTE: Errors in this function will cause the plugin to stop running. dvander@165: * dvander@165: * @noreturn dvander@165: */ dvander@212: forward OnPluginInit(Handle:myself); dvander@165: dvander@165: /** dvander@212: * Called before OnPluginInit, in case the plugin wants to check for load failure. dvander@212: * This is called even if the plugin type is "private." Any natives from modules are dvander@212: * not available at this point. Thus, this forward should only be used for explicit dvander@212: * pre-emptive things, such as adding dynamic natives, or setting certain types of load filters. dvander@212: * dvander@212: * NOTE: It is not safe to call externally resolved natives until OnPluginInit(). dvander@212: * NOTE: Any sort of RTE in this function will cause the plugin to fail loading. dvander@165: * dvander@165: * @param myself Handle to the plugin. dvander@165: * @param late Whether or not the plugin was loaded "late" (after map load). dvander@165: * @param error Error message buffer in case load failed. dvander@165: * @param err_max Maximum number of characters for error message buffer. faluco@242: * @return True if load success, false otherwise. dvander@165: */ dvander@212: forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max); dvander@165: dvander@165: /** dvander@165: * Called when the plugin is about to be unloaded. dvander@165: * dvander@165: * @noreturn dvander@165: */ dvander@165: forward OnPluginUnload(); dvander@165: dvander@165: /** dvander@165: * Called when the plugin's pause status is changing. dvander@165: * dvander@165: * @noreturn dvander@165: */ dvander@165: forward OnPluginPauseChange(bool:pause); faluco@242: faluco@242: /** faluco@242: * Called on client connection. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @param rejectmsg Buffer to store the rejection message when the connection is refused. faluco@242: * @param maxlen Maximum number of characters for rejection buffer. faluco@242: * @return True to validate client's connection, false to refuse it. faluco@242: */ faluco@242: forward bool:OnClientConnect(client, String:rejectmsg[], maxlen); faluco@242: faluco@242: /** faluco@242: * Called when a client is entering to the game. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @noreturn faluco@242: */ faluco@242: forward OnClientPutInServer(client); faluco@242: faluco@242: /** faluco@242: * Called when a client is disconnecting from the server. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @noreturn faluco@242: */ faluco@242: forward OnClientDisconnect(client); faluco@242: faluco@242: /** faluco@242: * Called when a client is disconnected from the server. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @noreturn faluco@242: */ faluco@242: forward OnClientDisconnect_Post(client); faluco@242: faluco@242: /** faluco@242: * Called when a client is sending a command. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @noreturn faluco@242: */ faluco@242: forward OnClientCommand(client); faluco@242: faluco@242: /** faluco@242: * Called whenever the client's settings are changed. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @noreturn faluco@242: */ faluco@242: forward OnClientSettingsChanged(client); faluco@242: faluco@242: /** faluco@242: * Returns the maximum number of clients allowed on the server. faluco@242: * faluco@242: * @return Maximum number of clients allowed. faluco@242: */ faluco@242: native GetMaxClients(); faluco@242: faluco@242: /** faluco@242: * Returns the client count put in the server. faluco@242: * faluco@242: * @param inGameOnly If false connecting players are also counted. faluco@242: * @return Client count in the server. faluco@242: */ faluco@242: native GetClientCount(bool:inGameOnly=true); faluco@242: faluco@242: /** faluco@242: * Returns the client's name. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @param name Buffer to store the client's name. faluco@242: * @param maxlen Maximum length of string buffer (includes NULL terminator). dvander@257: * @return True on success, false otherwise. faluco@258: * @error If the client is not connected an error will be thrown. faluco@242: */ dvander@257: native bool:GetClientName(client, String:name[], maxlen); faluco@242: faluco@242: /** dvander@250: * Retrieves a client's IP address. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @param name Buffer to store the client's ip address. faluco@242: * @param maxlen Maximum length of string buffer (includes NULL terminator). dvander@257: * @return True on success, false otherwise. faluco@258: * @error If the client is not connected an error will be thrown. faluco@242: */ dvander@257: native bool:GetClientIP(client, String:ip[], maxlen); faluco@242: faluco@242: /** dvander@250: * Retrieves a client's authentication string (SteamID). faluco@242: * faluco@242: * @param client Player index. faluco@242: * @param auth Buffer to store the client's auth string. faluco@242: * @param maxlen Maximum length of string buffer (includes NULL terminator). dvander@257: * @return True on success, false otherwise. faluco@258: * @error If the client is not connected an error will be thrown. faluco@242: */ dvander@257: native bool:GetClientAuthString(client, String:auth[], maxlen); faluco@242: faluco@242: /** faluco@242: * Returns if a certain player is connected. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @return True if player is connected to the server, false otherwise. faluco@242: */ faluco@242: native bool:IsPlayerConnected(client); faluco@242: faluco@242: /** faluco@242: * Returns if a certain player has entered the game. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @return True if player has entered the game, false otherwise. faluco@242: */ faluco@242: native bool:IsPlayerInGame(client); faluco@242: faluco@242: /** faluco@242: * Returns if a certain player has been authenticated. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @return True if player has been authenticated, false otherwise. faluco@242: */ faluco@242: native bool:IsPlayerAuthorized(client); faluco@242: faluco@242: /** faluco@242: * Returns if a certain player is a fake client. faluco@242: * faluco@242: * @param client Player index. faluco@242: * @return True if player is a fake client, false otherwise. faluco@242: */ faluco@242: native bool:IsPlayerFakeClient(client);