Raised This Month: $51 Target: $400
 12% 

Full Server Slot Reservation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 05-13-2016 , 08:05   Full Server Slot Reservation
Reply With Quote #1

Tested plugin and works but have problem when admin try to connect first show this message and admin need again to connect to enter the server. Can you remove this or fix this not to show it
Attached Files
File Type: zip Full_Server_Slo.zip (11.1 KB, 59 views)
Ant1Lamer is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-13-2016 , 08:52   Re: Full Server Slot Reservation
Reply With Quote #2

PHP Code:
// ================================================================================================
//
//    Plugin:  Full Server Slot Reservation
//    Version: 0.2.1
//    Authors: PomanoB & droper
//
//    Copyright © 2011 - 2013
//
// ================================================================================================

#include < amxmodx >
#include < amxmisc >  
#include < orpheu >

// ================================================================================================
//
//    Макроконстанты
//
// ================================================================================================

#define PLUGIN    "Full Server Slot Reservation"
#define VERSION    "0.2.1"
#define AUTHOR    "PomanoB & droper"

// Проверять пароль _pw или нет
#define PASSWORD_CHECK

// Причина кика
#define KICK_REASON "Slot reservation! You unluck player!"


#if defined PASSWORD_CHECK

    // Строка должна быть такой же как и в кваре amx_password_field ( но \ в начале и конце обязательны )
    
new const g_passwordField[] = "\_pw\";
#endif

// ================================================================================================
//
//    Глобальные переменные
//
// ================================================================================================

new g_maxplayers = 0;


// ================================================================================================
//
//    plugin_precache ()
//
// ================================================================================================

public plugin_precache ( )
{
    register_plugin ( PLUGIN, VERSION, AUTHOR );

    OrpheuRegisterHook ( OrpheuGetFunction ( "
SV_ConnectClient" ), "OnSV_ConnectClient" );

    g_maxplayers = get_maxplayers ( );
}

// ================================================================================================
//
//    OnSV_ConnectClient ()
//
// ================================================================================================

public OrpheuHookReturn:OnSV_ConnectClient ( )
{
    static szInfo[512], szName[ 32 ], iPos, iCount, iFlags;

    read_args ( szInfo, charsmax( szInfo ) );

    szInfo[ strlen ( szInfo ) - 1 ] = EOS;

    iPos = contain ( szInfo, "
\name\" );

    copyc ( szName, charsmax( szName ), szInfo[ iPos + 6 ], '\' );

#if defined PASSWORD_CHECK

        static szPassword[ 64 ];

        iPos = contain ( szInfo, g_passwordField );

        if ( iPos != -1 )
        {
            copyc ( szPassword, charsmax( szPassword), szInfo[ iPos + charsmax( g_passwordField ) ], '\' );
        }
        else
        {
            szPassword[ 0 ] = EOS;
        }
#endif

    iCount = admins_num ( );

    for ( iPos = 0; iPos < iCount; iPos++ )
    {
        iFlags = admins_lookup ( iPos, AdminProp_Flags );

        admins_lookup ( iPos, AdminProp_Auth, szInfo, charsmax( szInfo ) );

        if ( iFlags & ( FLAG_AUTHID | FLAG_IP ) )
        {
            continue;
        }

        if ( iFlags & FLAG_TAG )
        {
            if ( iFlags & FLAG_CASE_SENSITIVE )
            {
                if ( contain ( szName, szInfo ) != -1 )
                {
                    break;
                }
            }
            else if ( contain ( szName, szInfo ) != -1 )
            {
                break;
            }
        }
        else
        {

            if ( iFlags & FLAG_CASE_SENSITIVE )
            {
                if ( equal ( szInfo, szName ) )
                {
                    break;
                }
            }
            else
            {
                if ( equali ( szInfo, szName ) )
                {
                    break;

                }
            }
        }

    }

    if ( iPos == iCount )
    {
        return OrpheuIgnored;
    }

#if defined PASSWORD_CHECK

        if ( !( iFlags & FLAG_NOPASS ) )
        {
            admins_lookup ( iPos, AdminProp_Password, szInfo, charsmax( szInfo ) );

            if ( !equal ( szInfo, szPassword ) )
            {
                return OrpheuIgnored;
            }
        }
#endif

    iPos = findKickedPlayer ( );

    if ( iPos && !is_user_admin(iPos) )
    {
        server_cmd ( "
kick #%d ^"%s^"", get_user_userid ( iPos ), KICK_REASON );
        
server_exec ( );
    }

    return 
OrpheuIgnored;
}

// ================================================================================================
//
//    findKickedPlayer ()
//
// ================================================================================================

public findKickedPlayer()
{
    static 
iiUnluckPlayeriPlayersNum;

    
iUnluckPlayer 0;

    
iPlayersNum 0;

    for ( 
1<= g_maxplayersi++ )
    {
        if ( 
is_user_connected ) )
        {
            
iPlayersNum++

            if ( !
iUnluckPlayer && !is_user_bot ) )
            {
                
iUnluckPlayer i;
            }
        }
    }

    if ( 
iUnluckPlayer && iPlayersNum == g_maxplayers )
    {
        return 
iUnluckPlayer;
    }

    return 
0;


Last edited by siriusmd99; 05-13-2016 at 13:48.
siriusmd99 is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 05-13-2016 , 10:30   Re: Full Server Slot Reservation
Reply With Quote #3

Edit: I fixed this just add
PHP Code:
#include <amxmisc> 

Last edited by Ant1Lamer; 05-13-2016 at 11:16. Reason: I fixed just add #include <amxmisc>
Ant1Lamer is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-13-2016 , 13:44   Re: Full Server Slot Reservation
Reply With Quote #4

Quote:
Originally Posted by Ant1Lamer View Post
Edit: I fixed this just add
PHP Code:
#include <amxmisc> 
Yes sorry , i always confuse admin flags functions with their include file.
I thought it's amxmodx ... Sorry for this. I updated also in my post.

Last edited by siriusmd99; 05-13-2016 at 13:48.
siriusmd99 is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 05-13-2016 , 15:51   Re: Full Server Slot Reservation
Reply With Quote #5

np man so i tested plugin and same :X i'm with steam

Last edited by Ant1Lamer; 05-13-2016 at 15:53.
Ant1Lamer is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 05-26-2016 , 02:57   Re: Full Server Slot Reservation
Reply With Quote #6

upp maybe the problem in orpheu or steam player or other i dont know any help ?
Ant1Lamer is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 06-19-2016 , 08:17   Re: Full Server Slot Reservation
Reply With Quote #7

UP any idea ?
Ant1Lamer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode