You really cannot figure it out yourself? You might as well post in requests next time.
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include < sqlx >
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new Handle: g_SqlHandle
new g_QueryCache[ 256 ]
public plugin_init( )
{
g_SqlHandle = SQL_MakeStdTuple( )
}
public client_connect( id )
{
new szAuthid[ 34 ]
get_user_authid( id, szAuthid, charsmax( szAuthid ) )
formatex( g_QueryCache, charsmax( g_QueryCache ), "INSERT INTO table VALUES ('%s', 1) ON DUPLICATE KEY online=1", szAuthid )
SQL_ThreadQuery( g_SqlHandle, "SQL__HANDLE_DROP", g_QueryCache )
}
public client_disconnect( id )
{
new szAuthid[ 34 ]
get_user_authid( id, szAuthid, charsmax( szAuthid ) )
formatex( g_QueryCache, charsmax( g_QueryCache ), "INSERT INTO table VALUES ('%s', 0) ON DUPLICATE KEY online=0", szAuthid )
SQL_ThreadQuery( g_SqlHandle, "SQL__HANDLE_DROP", g_QueryCache )
}
public SQL__HANDLE_DROP( ) { }