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

Connections Counter


Post New Thread Reply   
 
Thread Tools Display Modes
Melisko
Senior Member
Join Date: Feb 2010
Old 03-13-2010 , 17:58   Re: Connections Counter
Reply With Quote #21

Mein got.... Plugin works Badly!!! I was playing on server 10 minutes , I reconected and when I write /playtime , it says that Im on server just 2 minutes.... And also that Status , I join server 5 times for test , And it says that I join server onli second time.... Wtf?!
Melisko is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2010 , 18:14   Re: Connections Counter
Reply With Quote #22

You probably need to make the changes listed in post #16.
__________________
fysiks is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 03-13-2010 , 18:16   Re: Connections Counter
Reply With Quote #23

Quote:
Originally Posted by fysiks View Post
You probably need to make the changes listed in post #16.
Im not a scripter.... I can only test it... right now if U make a new one
Melisko is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-13-2010 , 18:30   Re: Connections Counter
Reply With Quote #24

It worked perfectly during testing but I will double check and re test for you. Post 16 changes will not affect functionality. My power is currently out, once it comes back I'll double check the source and respond to Exolents post.
__________________
Bugsy is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 03-13-2010 , 18:32   Re: Connections Counter
Reply With Quote #25

Its not working perfectly... why is deadchat on???
also playtime and your plugin dont work correct! , I reconect and time is still same

Another bug , End of the map : /playtime is same! also the number of connections!!!

And sry for those messages... Maybe Im too angry but this plugin can be awesome and I really want it on my server

Last edited by Melisko; 03-13-2010 at 18:41.
Melisko is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-13-2010 , 18:49   Re: Connections Counter
Reply With Quote #26

Ok dude just relax, bugs can be worked out and changes can be made. It did work for me in my tests.
__________________
Bugsy is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 03-13-2010 , 18:57   Re: Connections Counter
Reply With Quote #27

Ok , when U post new vesrion , I test it
Melisko is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-13-2010 , 19:09   Re: Connections Counter
Reply With Quote #28

Here is a quick fix until Bugsy can post:
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < nvault >

const MAX_PLAYERS 32;

new const 
Version[] = "0.1";
new const 
VaultName[] = "ConnectData";

enum ConnectionStatus
{
    
Newbie,
    
SemiPro,
    
Pro,
    
Veteran
}
new const 
StatusDescriptionConnectionStatus ][] = 
{
    
"Newbie",
    
"Semi-Pro",
    
"Pro",
    
"Veteran"
};

enum StatusLevelRange
{
    
Floor,
    
Ceiling
}
new const 
StatusLevelsConnectionStatus ][ StatusLevelRange ] = 
{
    { 
100 },    
    { 
101 500 },    
    { 
501 750 },    
    { 
751 99999 }
};

new const 
TeamsCsTeams ][] = 
{
    
"(Unassigned)",
    
"(Terrorist)"
    
"(Counter-Terrorist)",
    
"(Spectator)"
};

enum PlayerData
{
    
Name33 ],
    
AuthID35 ],
    
Connections,
    
Status,
    
PlayTime,
    
LeaveMsg128 ]
}

new 
g_PDataMAX_PLAYERS ][ PlayerData ];
new 
bool:g_bIsBotMAX_PLAYERS ];

new 
g_iVault;
new 
g_iMsgSayText;

const 
g_MaxNumber 0x7FFFFFF;
const 
g_DummyChar '0';
new 
szLoadSaveBuffer[ (sizeofg_PData[] ) * 4) + ];

new 
pCvar_AllChat;

public 
plugin_init( )
{
    
register_plugin"Connections and Time" Version "bugsy" );
    
    
register_clcmd"say" "HookSay" );
    
register_clcmd"say_team" "HookSay_Team" );
    
    
pCvar_AllChat register_cvar"amx_allchat""0" );
    
    
g_iMsgSayText get_user_msgid"SayText" );

    
g_iVault nvault_openVaultName );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    
g_bIsBotid ] = bool:!!is_user_botid );
    
    if ( 
g_bIsBotid ] )
        return 
PLUGIN_CONTINUE;
        
    
get_user_authidid g_PDataid ][ AuthID ] , charsmaxg_PData[] ) );
    
    if ( 
nvault_getg_iVault g_PDataid ][ AuthID ] , szLoadSaveBuffer charsmaxszLoadSaveBuffer ) ) )
        
LoadArrayszLoadSaveBuffer charsmaxszLoadSaveBuffer ) , g_PDataid ][ PlayerData:] );

    
/*server_print( "%s %s %d %d %d %s" , g_PData[ id ][ Name ] , 
                    g_PData[ id ][ AuthID ] , 
                    g_PData[ id ][ Connections ] , 
                    g_PData[ id ][ Status ] ,
                    g_PData[ id ][ PlayTime ] ,
                    g_PData[ id ][ LeaveMsg ] );*/
                    
    
get_user_nameid g_PDataid ][ Name ] , charsmaxg_PData[] ) );
    
g_PDataid ][ Connections ]++;
    
    for ( new 
ConnectionStatus:Newbie Veteran i++ )
    {
        if ( 
StatusLevels][ Floor ] <= g_PDataid ][ Connections ] <= StatusLevels][ Ceiling ] )
        {
            
g_PDataid ][ Status ] = _:i;
            break;
        }
    }
    
    
set_task7.0 "ShowJoinMsg" id );
    
    return 
PLUGIN_CONTINUE;
}

public 
ShowJoinMsgid )
{
    static 
szMessage128 ];

    
formatexszMessage charsmaxszMessage) , "^x04* ^x03%s has joined with^x04 %d^x03 connections. [^x04Status: %s^x03]" g_PDataid ][ Name ] , g_PDataid ][ Connections ], StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] );
    Print( 
id szMessage );
}

public 
client_disconnectid )
{
    if ( 
g_bIsBotid ] )
        return 
PLUGIN_CONTINUE;
        
    static 
szMessage128 ];
    
    
remove_taskid );
    
    
g_PDataid ][ PlayTime ] += get_user_timeid );
    
    
SaveArrayg_PDataid ][ PlayerData:] , sizeofg_PData[] ) , szLoadSaveBuffer );
    
    
nvault_setg_iVault g_PDataid ][ AuthID ] , szLoadSaveBuffer );
    
    if( 
ConnectionStatus:g_PDataid ][ Status ] == Veteran )
    {
        
formatexszMessage charsmaxszMessage ) , "^x04* ^x03Veteran: %s has left the server. [^x04Message: %s^x03]" g_PDataid ][ Name ] , g_PDataid ][ LeaveMsg ] );
        Print( 
szMessage );
    }
    
    
g_PDataid ][ Name ][ ] = EOS;
    
g_PDataid ][ AuthID ][ ] = EOS;
    
g_PDataid ][ Connections ] = 0;
    
g_PDataid ][ Status ] = 0;    
    
g_PDataid ][ PlayTime ] = 0;
    
g_PDataid ][ LeaveMsg ][ ] = EOS;
    
    return 
PLUGIN_CONTINUE;
}

public 
HookSayid )
{
    static 
szMessage256 ] , szMsgSaid256 ];
    
read_argsszMsgSaid charsmaxszMsgSaid ) );
    
remove_quotesszMsgSaid );
    
    
//   /leavemsg
    
if( ConnectionStatus:g_PDataid ][ Status ] == Veteran )
    {
        if( 
szMsgSaid] == '/' && szMsgSaid] == 'e' && szMsgSaid] == 'v' && szMsgSaid] == 'm' )
        {
            new 
Arg64 ];
            
strbreakszMsgSaid szMsgSaid 95 Arg 63 );
            
remove_quotesArg );
    
            if( !
Arg] )
            {
                if( 
g_PDataid ][ LeaveMsg ][ ]  )
                {
                    
client_printidprint_chat"* Your current leave message is ^"%s^"" g_PDataid ][ LeaveMsg ] );
                }
                else
                {
                    
client_printidprint_chat"* You haven't set a leave message yet. To do so, type /leavemsg ^"message^"." );
                }
            }
            else if( 
equaliArg "remove" ) )
            {
                
g_PDataid ][ LeaveMsg ][ ] = EOS;
                
client_printidprint_chat"* Your leave message was removed." );
            }
            else
            {
                
copyg_PDataid ][ LeaveMsg ] , charsmaxg_PData[] ) , Arg );
                
client_printid print_chat "* Your leave message has been set to ^"%s^""Arg );
            }
            return 
PLUGIN_HANDLED;
        }
    }
    
    
//   /playtime
    
if ( szMsgSaid] == '/' && szMsgSaid] == 'p' && szMsgSaid] == 'y' && szMsgSaid] == 'm' )
    {
        new 
iHours iDays iMinutes iCurTime;
        static 
szPlayTime128 ] , iPos;
        
        
formatexszMessage charsmaxszMessage) , "^x04*^x03 You currently have^x04 %d^x03 connections. [^x04Status: %s^x03]" g_PDataid ][ Connections ] , StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] );
        Print( 
id id szMessage );
        
        
iCurTime g_PDataid ][ PlayTime ] + get_user_timeid );
        
iPos 0;
        
        if ( 
iCurTime >= 86400 )
        {
            
iDays iCurTime 86400;
            
iCurTime -= iDays 86400;
            
iPos formatexszPlayTime charsmaxszPlayTime ) , "%d days, " iDays );
        }
        if ( 
iCurTime >= 3600 )
        {
            
iHours iCurTime 3600;
            
iCurTime -= iHours 3600;
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d hour%s, " iHours iHours "s" "" );
        }
        if ( 
iCurTime >= 60 )
        {
            
iMinutes iCurTime 60;
            
iCurTime -= iMinutes 60;
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d minute%s, " iMinutes iMinutes "s" "" );
        }
        if ( 
iCurTime )
        {
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d second%s, " iCurTime iCurTime "s" "" );
        }
        
        
szPlayTimeiPos ] = EOS;
        
        
formatexszMessage charsmaxszMessage ) , "^x04*^x03 You have played on this server for:^x04 %s"szPlayTime );
        Print( 
id id szMessage );
        
        return 
PLUGIN_HANDLED;
    }
    
    if ( !
szMsgSaid] || szMsgSaid[0] == '@' || szMsgSaid[0] == '/' || szMsgSaid[0] == '!' )
        return 
PLUGIN_CONTINUE;
    
    if ( 
is_user_aliveid ) )
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , g_PDataid ][ Name ] , szMsgSaid );
    else 
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , ( cs_get_user_teamid ) != CS_TEAM_SPECTATOR ) ? "*DEAD*" "*SPEC*" g_PDataid ][ Name ] , szMsgSaid );

    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNumget_pcvar_numpCvar_AllChat ) ? "" : ( is_user_aliveid ) ? "a" "b" ) );
    
    for( new 
0iPlayeriNumi++ )
        Print( 
iPlayers], idszMessage );
    
    return 
PLUGIN_HANDLED;
}

public 
HookSay_Teamid )
{
    static 
szMessage256 ] , szMsgSaid256 ];
    new 
CsTeams:iTeam;
    
    
read_argsszMsgSaid charsmaxszMsgSaid ) );
    
remove_quotesszMsgSaid );

    
iTeam cs_get_user_teamid );
    
    if ( !
szMsgSaid] || szMsgSaid[0] == '@' || szMsgSaid[0] == '/' || szMsgSaid[0] == '!' )
        return 
PLUGIN_CONTINUE;
    
    if ( 
is_user_aliveid ) || ( iTeam == CS_TEAM_SPECTATOR ) )
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , TeamsiTeam ] , g_PDataid ][ Name ] , szMsgSaid );
    else 
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 *DEAD* %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , TeamsiTeam ], g_PDataid ][ Name ] , szMsgSaid );

    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNumget_pcvar_numpCvar_AllChat ) ? "" : ( is_user_aliveid ) ? "a" "b" ) );
    
    for( new 
0iPlayeriNumi++ )
    {
        
iPlayer iPlayers];
        
        if( 
cs_get_user_teamiPlayer ) == iTeam )
            Print( 
iPlayeridszMessage );
    }
        
    return 
PLUGIN_HANDLED;
}

Print( 
id colorid szMessage[] )
{
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgSayText, {0,0,0} , id );
    
write_bytecolorid );
    
write_stringszMessage );
    
message_end();
}

SaveArray( const SourceArray[] , iSize DestString[] )
{
    new 
iPos = -SourceTmp];
    
    for ( new 
iSize i++ )
    {        
        if ( ( 
SourceArray] > g_MaxNumber ) || ( SourceArray] < -g_MaxNumber ) )
            return 
0;
                
        
SourceTmp] = SourceArray];
        
        ++
iPos;
        
        if ( 
SourceTmp] < )
        {
            
DestStringiPos ] = ( << );
            
SourceTmp] *= -1;
        }
        
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
        
DestStringiPos ] |=  SourceTmp};
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
    }
    
    return 
1;
}

LoadArray( const SourceString[] , iLen DestArray[] )
{
    new 
iPos = -1;
    
    for ( new 
iLen += 
    { 
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceStringi     ] & ~0xF8;
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString];
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString]; 
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString];
        
        
DestArray[ ( ) ] *= ( SourceString] & ( << ) ) ? -1;
    }
    
    return 
1

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 03-13-2010 , 19:10   Re: Connections Counter
Reply With Quote #29

Quote:
Originally Posted by Exolent[jNr] View Post
Here is a quick fix until Bugsy can post:
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < nvault >

const MAX_PLAYERS 32;

new const 
Version[] = "0.1";
new const 
VaultName[] = "ConnectData";

enum ConnectionStatus
{
    
Newbie,
    
SemiPro,
    
Pro,
    
Veteran
}
new const 
StatusDescriptionConnectionStatus ][] = 
{
    
"Newbie",
    
"Semi-Pro",
    
"Pro",
    
"Veteran"
};

enum StatusLevelRange
{
    
Floor,
    
Ceiling
}
new const 
StatusLevelsConnectionStatus ][ StatusLevelRange ] = 
{
    { 
100 },    
    { 
101 500 },    
    { 
501 750 },    
    { 
751 99999 }
};

new const 
TeamsCsTeams ][] = 
{
    
"(Unassigned)",
    
"(Terrorist)"
    
"(Counter-Terrorist)",
    
"(Spectator)"
};

enum PlayerData
{
    
Name33 ],
    
AuthID35 ],
    
Connections,
    
Status,
    
PlayTime,
    
LeaveMsg128 ]
}

new 
g_PDataMAX_PLAYERS ][ PlayerData ];
new 
bool:g_bIsBotMAX_PLAYERS ];

new 
g_iVault;
new 
g_iMsgSayText;

const 
g_MaxNumber 0x7FFFFFF;
const 
g_DummyChar '0';
new 
szLoadSaveBuffer[ (sizeofg_PData[] ) * 4) + ];

new 
pCvar_AllChat;

public 
plugin_init( )
{
    
register_plugin"Connections and Time" Version "bugsy" );
    
    
register_clcmd"say" "HookSay" );
    
register_clcmd"say_team" "HookSay_Team" );
    
    
pCvar_AllChat register_cvar"amx_allchat""0" );
    
    
g_iMsgSayText get_user_msgid"SayText" );

    
g_iVault nvault_openVaultName );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    
g_bIsBotid ] = bool:!!is_user_botid );
    
    if ( 
g_bIsBotid ] )
        return 
PLUGIN_CONTINUE;
        
    
get_user_authidid g_PDataid ][ AuthID ] , charsmaxg_PData[] ) );
    
    if ( 
nvault_getg_iVault g_PDataid ][ AuthID ] , szLoadSaveBuffer charsmaxszLoadSaveBuffer ) ) )
        
LoadArrayszLoadSaveBuffer charsmaxszLoadSaveBuffer ) , g_PDataid ][ PlayerData:] );

    
/*server_print( "%s %s %d %d %d %s" , g_PData[ id ][ Name ] , 
                    g_PData[ id ][ AuthID ] , 
                    g_PData[ id ][ Connections ] , 
                    g_PData[ id ][ Status ] ,
                    g_PData[ id ][ PlayTime ] ,
                    g_PData[ id ][ LeaveMsg ] );*/
                    
    
get_user_nameid g_PDataid ][ Name ] , charsmaxg_PData[] ) );
    
g_PDataid ][ Connections ]++;
    
    for ( new 
ConnectionStatus:Newbie Veteran i++ )
    {
        if ( 
StatusLevels][ Floor ] <= g_PDataid ][ Connections ] <= StatusLevels][ Ceiling ] )
        {
            
g_PDataid ][ Status ] = _:i;
            break;
        }
    }
    
    
set_task7.0 "ShowJoinMsg" id );
    
    return 
PLUGIN_CONTINUE;
}

public 
ShowJoinMsgid )
{
    static 
szMessage128 ];

    
formatexszMessage charsmaxszMessage) , "^x04* ^x03%s has joined with^x04 %d^x03 connections. [^x04Status: %s^x03]" g_PDataid ][ Name ] , g_PDataid ][ Connections ], StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] );
    Print( 
id szMessage );
}

public 
client_disconnectid )
{
    if ( 
g_bIsBotid ] )
        return 
PLUGIN_CONTINUE;
        
    static 
szMessage128 ];
    
    
remove_taskid );
    
    
g_PDataid ][ PlayTime ] += get_user_timeid );
    
    
SaveArrayg_PDataid ][ PlayerData:] , sizeofg_PData[] ) , szLoadSaveBuffer );
    
    
nvault_setg_iVault g_PDataid ][ AuthID ] , szLoadSaveBuffer );
    
    if( 
ConnectionStatus:g_PDataid ][ Status ] == Veteran )
    {
        
formatexszMessage charsmaxszMessage ) , "^x04* ^x03Veteran: %s has left the server. [^x04Message: %s^x03]" g_PDataid ][ Name ] , g_PDataid ][ LeaveMsg ] );
        Print( 
szMessage );
    }
    
    
g_PDataid ][ Name ][ ] = EOS;
    
g_PDataid ][ AuthID ][ ] = EOS;
    
g_PDataid ][ Connections ] = 0;
    
g_PDataid ][ Status ] = 0;    
    
g_PDataid ][ PlayTime ] = 0;
    
g_PDataid ][ LeaveMsg ][ ] = EOS;
    
    return 
PLUGIN_CONTINUE;
}

public 
HookSayid )
{
    static 
szMessage256 ] , szMsgSaid256 ];
    
read_argsszMsgSaid charsmaxszMsgSaid ) );
    
remove_quotesszMsgSaid );
    
    
//   /leavemsg
    
if( ConnectionStatus:g_PDataid ][ Status ] == Veteran )
    {
        if( 
szMsgSaid] == '/' && szMsgSaid] == 'e' && szMsgSaid] == 'v' && szMsgSaid] == 'm' )
        {
            new 
Arg64 ];
            
strbreakszMsgSaid szMsgSaid 95 Arg 63 );
            
remove_quotesArg );
    
            if( !
Arg] )
            {
                if( 
g_PDataid ][ LeaveMsg ][ ]  )
                {
                    
client_printidprint_chat"* Your current leave message is ^"%s^"" g_PDataid ][ LeaveMsg ] );
                }
                else
                {
                    
client_printidprint_chat"* You haven't set a leave message yet. To do so, type /leavemsg ^"message^"." );
                }
            }
            else if( 
equaliArg "remove" ) )
            {
                
g_PDataid ][ LeaveMsg ][ ] = EOS;
                
client_printidprint_chat"* Your leave message was removed." );
            }
            else
            {
                
copyg_PDataid ][ LeaveMsg ] , charsmaxg_PData[] ) , Arg );
                
client_printid print_chat "* Your leave message has been set to ^"%s^""Arg );
            }
            return 
PLUGIN_HANDLED;
        }
    }
    
    
//   /playtime
    
if ( szMsgSaid] == '/' && szMsgSaid] == 'p' && szMsgSaid] == 'y' && szMsgSaid] == 'm' )
    {
        new 
iHours iDays iMinutes iCurTime;
        static 
szPlayTime128 ] , iPos;
        
        
formatexszMessage charsmaxszMessage) , "^x04*^x03 You currently have^x04 %d^x03 connections. [^x04Status: %s^x03]" g_PDataid ][ Connections ] , StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] );
        Print( 
id id szMessage );
        
        
iCurTime g_PDataid ][ PlayTime ] + get_user_timeid );
        
iPos 0;
        
        if ( 
iCurTime >= 86400 )
        {
            
iDays iCurTime 86400;
            
iCurTime -= iDays 86400;
            
iPos formatexszPlayTime charsmaxszPlayTime ) , "%d days, " iDays );
        }
        if ( 
iCurTime >= 3600 )
        {
            
iHours iCurTime 3600;
            
iCurTime -= iHours 3600;
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d hour%s, " iHours iHours "s" "" );
        }
        if ( 
iCurTime >= 60 )
        {
            
iMinutes iCurTime 60;
            
iCurTime -= iMinutes 60;
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d minute%s, " iMinutes iMinutes "s" "" );
        }
        if ( 
iCurTime )
        {
            
iPos += formatexszPlayTimeiPos ] , charsmaxszPlayTime ) - iPos "%d second%s, " iCurTime iCurTime "s" "" );
        }
        
        
szPlayTimeiPos ] = EOS;
        
        
formatexszMessage charsmaxszMessage ) , "^x04*^x03 You have played on this server for:^x04 %s"szPlayTime );
        Print( 
id id szMessage );
        
        return 
PLUGIN_HANDLED;
    }
    
    if ( !
szMsgSaid] || szMsgSaid[0] == '@' || szMsgSaid[0] == '/' || szMsgSaid[0] == '!' )
        return 
PLUGIN_CONTINUE;
    
    if ( 
is_user_aliveid ) )
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , g_PDataid ][ Name ] , szMsgSaid );
    else 
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , ( cs_get_user_teamid ) != CS_TEAM_SPECTATOR ) ? "*DEAD*" "*SPEC*" g_PDataid ][ Name ] , szMsgSaid );

    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNumget_pcvar_numpCvar_AllChat ) ? "" : ( is_user_aliveid ) ? "a" "b" ) );
    
    for( new 
0iPlayeriNumi++ )
        Print( 
iPlayers], idszMessage );
    
    return 
PLUGIN_HANDLED;
}

public 
HookSay_Teamid )
{
    static 
szMessage256 ] , szMsgSaid256 ];
    new 
CsTeams:iTeam;
    
    
read_argsszMsgSaid charsmaxszMsgSaid ) );
    
remove_quotesszMsgSaid );

    
iTeam cs_get_user_teamid );
    
    if ( !
szMsgSaid] || szMsgSaid[0] == '@' || szMsgSaid[0] == '/' || szMsgSaid[0] == '!' )
        return 
PLUGIN_CONTINUE;
    
    if ( 
is_user_aliveid ) || ( iTeam == CS_TEAM_SPECTATOR ) )
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , TeamsiTeam ] , g_PDataid ][ Name ] , szMsgSaid );
    else 
        
formatexszMessage charsmaxszMessage ) , "^x04[%s]^x01 *DEAD* %s^x03 %s^x01 :  %s"StatusDescriptionConnectionStatus:g_PDataid ][ Status ] ] , TeamsiTeam ], g_PDataid ][ Name ] , szMsgSaid );

    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNumget_pcvar_numpCvar_AllChat ) ? "" : ( is_user_aliveid ) ? "a" "b" ) );
    
    for( new 
0iPlayeriNumi++ )
    {
        
iPlayer iPlayers];
        
        if( 
cs_get_user_teamiPlayer ) == iTeam )
            Print( 
iPlayeridszMessage );
    }
        
    return 
PLUGIN_HANDLED;
}

Print( 
id colorid szMessage[] )
{
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgSayText, {0,0,0} , id );
    
write_bytecolorid );
    
write_stringszMessage );
    
message_end();
}

SaveArray( const SourceArray[] , iSize DestString[] )
{
    new 
iPos = -SourceTmp];
    
    for ( new 
iSize i++ )
    {        
        if ( ( 
SourceArray] > g_MaxNumber ) || ( SourceArray] < -g_MaxNumber ) )
            return 
0;
                
        
SourceTmp] = SourceArray];
        
        ++
iPos;
        
        if ( 
SourceTmp] < )
        {
            
DestStringiPos ] = ( << );
            
SourceTmp] *= -1;
        }
        
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
DestStringiPos ] |= SourceTmp} ? : ( << );
        
        
DestStringiPos ] |=  SourceTmp};
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
        
DestString[ ++iPos ] = SourceTmp} ? SourceTmp} : g_DummyChar;
    }
    
    return 
1;
}

LoadArray( const SourceString[] , iLen DestArray[] )
{
    new 
iPos = -1;
    
    for ( new 
iLen += 
    { 
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceStringi     ] & ~0xF8;
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString];
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString]; 
        
DestArray{ ++iPos } = ( SourceString] & ( << ) ) ? SourceString];
        
        
DestArray[ ( ) ] *= ( SourceString] & ( << ) ) ? -1;
    }
    
    return 
1


What things are fixed?
Melisko is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-13-2010 , 19:11   Re: Connections Counter
Reply With Quote #30

All chat has been changed to a cvar:
amx_allchat <0|1>
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 03:14.


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