Загрузка данных


/* ~ Includes. ~ */
#include < amxmisc >

/* ~ We cut off old versions. ~ */
#if AMXX_VERSION_NUM < 190
    #assert Outdated version of AMX Mod X (AMXX_VERSION_NUM), please update in order to use this plugin properly.
#endif

/* ~ Sub-includes. ~ */
#include < bio >

/* ~ Special instruction. ~ */
#pragma semicolon 1

/* ~ Forwards. ~ */
new m_fwdVersionCheck;

/* ~ This forward allows plugins to add models, sounds and generic files to the precache tables using the precache_* set of functions. ~ */
public plugin_precache( )
{
    // Sets informations about the calling plugin.
    register_plugin( "[BIO] Main", BIO_VERSION, "oxsi. x Vision" );

    // Creates a new cvar for the engine.
    create_cvar( "bio_version", BIO_VERSION, FCVAR_SERVER | FCVAR_EXTDLL | FCVAR_UNLOGGED | FCVAR_SPONLY, "Don't touch this!" );

    // Create a global forward (expects 2 string parameters).
    m_fwdVersionCheck = CreateMultiForward( "bio_version_check", ET_IGNORE, FP_STRING, FP_STRING );

    // Executes a forward. 
    ExecuteForward( m_fwdVersionCheck, _, BIO_VERSION_MAJOR, BIO_VERSION_MINOR );
}

/* ~ Called just before server deactivation and subsequent unloading of the plugin. ~ */
public plugin_end( )
{
    // We destroy it to prevent memory leaks!
    DestroyForward( m_fwdVersionCheck );
}

// bio.inc
#if defined _bio_included
    #endinput
#endif
#define _bio_included

#include < bio_version >

// bio_version.inc
#if defined _bio_version_included
    #endinput
#endif
#define _bio_version_included

#define BIO_VERSION_MAJOR "0"
#define BIO_VERSION_MINOR "0"
#define BIO_VERSION_PATCH "1"
#define BIO_VERSION BIO_VERSION_MAJOR + "." + BIO_VERSION_MINOR + "." + BIO_VERSION_PATCH

public bio_version_check( const major[ ], const minor[ ] )
{
    if ( strcmp( major, BIO_VERSION_MAJOR ) != 0 )
    {
        set_fail_state( "[BIO] Api major version mismatch; expected %s, real %s", BIO_VERSION_MAJOR, major );
        return;
    }

    if ( strcmp( minor, BIO_VERSION_MINOR ) != 0 )
    {
        set_fail_state( "[BIO] Api minor version mismatch; expected %s, real %s", BIO_VERSION_MINOR, minor );
        return;
    }
}