Función del plugin:
La funcionalidad que tiene este plugin es poder mandar una data a una web mediante un comando por say /datear mix o /datear pcw una vez mandado el comando se publica la ip en la pagina www.cincoya.net en caso de ser un cerrado o pcw se publicará la contraseña del servidor para que puedan ingresar. Tenia otra versión que publicaba la cantidad de players y mapa en caso de ser un mix, no la encontré, cuando la encuentre actualizo el thread.
Se puede modificar el fbid para poder datear con tu facebook.
Requisitos:
- MySQL
Foto:
- Sin cambiar el fbid:
- Cambiando el fbid:
Código:
PD: No publico el sistema web porque no es de mi autoria.
La funcionalidad que tiene este plugin es poder mandar una data a una web mediante un comando por say /datear mix o /datear pcw una vez mandado el comando se publica la ip en la pagina www.cincoya.net en caso de ser un cerrado o pcw se publicará la contraseña del servidor para que puedan ingresar. Tenia otra versión que publicaba la cantidad de players y mapa en caso de ser un mix, no la encontré, cuando la encuentre actualizo el thread.
Se puede modificar el fbid para poder datear con tu facebook.
Requisitos:
- MySQL
Foto:
- Sin cambiar el fbid:
- Cambiando el fbid:
Código:
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
enum
{
PCW,
MIX
};
enum _:DATA_PLUGIN
{
P_NOMBRE[ 20 ],
P_VERSION[ 10 ],
P_AUTOR[ 25 ],
P_PREFIJO[ 20 ]
};
enum _:DATA_MYSQL
{
MYSQL_USER[ 15 ],
MYSQL_PASS[ 15 ],
MYSQL_HOST[ 15 ],
MYSQL_DB[ 15 ],
MYSQL_TABLA[ 20 ]
};
new const g_szPlugin[ DATA_PLUGIN ] =
{
"DatearCincoYA",
"2.0",
"CincoYA.net",
"[CincoYA.net]"
};
new const g_szMysql[ DATA_MYSQL ] =
{
"cincoya_dataw2",
"qwerty3181",
"cincoya.net", // DATOS ABSOLETOS!
"cincoya_dataw2",
"Mensajes_plugin"
};
new const CINCOYA_CFG[ ] = "cincoya.cfg";
/* VARS */
new Handle:g_hTuple,
Float:g_Tiempo;
/* CVARS */
new cvar_fuid,
cvar_nombre;
public plugin_init( )
{
register_plugin( g_szPlugin[ P_NOMBRE ], g_szPlugin[ P_VERSION ], g_szPlugin[ P_AUTOR ] );
register_clcmd( "say", "clcmd_say" )
cvar_fuid = register_cvar( "cincoya_fbid", "526545870831860" );
cvar_nombre = register_cvar( "cincoya_nombre", "CincoYA Datas" );
g_Tiempo = 0.0;
MySQLx( );
}
public plugin_cfg( )
{
new iPath[ 256 ];
get_configsdir( iPath, charsmax( iPath ) );
format( iPath, charsmax( iPath ), "%s/%s", iPath, CINCOYA_CFG );
if( !file_exists( iPath ) )
{
if(write_file( iPath, "; ====================================================================== ", -1 ) )
{
write_file( iPath, "; Copyright ©2018 CincoYA.net - Desarollado por iNyx " );
write_file( iPath, "; Cvar | Valor " );
write_file( iPath, "; ====================================================================== " );
write_file( iPath, " " );
write_file( iPath, "cincoya_fbid ^"526545870831860^" ; FBID de tu pagina o perfil (Si no sabes como es tu FB ID , podes buscarlo aca https://findmyfbid.com/ , sino dejalo como esta)" );
write_file( iPath, "cincoya_nombre ^"CincoYA Datas^" ; Nombre de la persona que datea (Aparecera en CincoYA) EJ: Comunidad CincoYA" );
}
}
else
{
server_cmd( "exec %s", iPath );
server_cmd( "[CincoYA.net] Se ejecuto la configuracion: %s.", iPath );
}
if( is_plugin_loaded( "Pause Plugins" ) > -1 )
server_cmd( "amx_pausecfg add ^"DatearCincoYA^"" );
}
public clcmd_say( iId )
{
new g_szIp[ 64 ];
get_user_ip( 0, g_szIp, charsmax( g_szIp ), 0 );
if( equal( g_szIp, "127.0.0.1:27029" )
|| equal( g_szIp, "127.0.0.1:27031" )
|| equal( g_szIp, "127.0.0.1:27030" ) )
{
printf( 0, "!g%s!t Servidor bloqueado, saludos!g Kevin!t &!g iNyx!t.", g_szPlugin[ P_PREFIJO ] );
return PLUGIN_CONTINUE;
}
static iArgs[ 192 ];
read_args( iArgs, charsmax( iArgs ) );
remove_quotes( iArgs );
trim( iArgs );
if( iArgs[0] == '/' && iArgs[1] == 'd' && iArgs[2] == 'a' && iArgs[3] == 't' && iArgs[4] == 'e' && iArgs[5] == 'a' && iArgs[6] == 'r' )
{
if( get_gametime( ) < g_Tiempo )
{
new Float:tl = g_Tiempo-get_gametime( );
new iMin = floatround( tl/60, floatround_floor );
printf( 0, "!g%s !tFaltan !g%d!t:!g%d!t (min:seg) para poder ejecutarlo nuevamente.", g_szPlugin[ P_PREFIJO ], iMin, floatround( tl - ( iMin*60 ), floatround_floor ) );
return PLUGIN_CONTINUE;
}
if( iArgs[7] && iArgs[7] == ' ' )
{
if( iArgs[8] == 'm' && iArgs[9] == 'i' && iArgs[10] == 'x' )
{
send_post( iId, MIX );
}
else if( iArgs[8] == 'p' && iArgs[9] == 'c' && iArgs[10] == 'w' )
{
send_post( iId, PCW );
}
else
{
printf( 0, "!g%s !tError. - !gModo de uso: !t/datear mix o /datear pcw ", g_szPlugin[ P_PREFIJO ] );
return PLUGIN_CONTINUE;
}
}
else
{
printf( 0, "!g%s !tError. - !gModo de uso: !t/datear mix o /datear pcw ", g_szPlugin[ P_PREFIJO ] );
return PLUGIN_CONTINUE;
}
printf( 0, "!g%s !tData Enviada. - !gPlugin Desarrollado por !tCincoYA.net", g_szPlugin[ P_PREFIJO ] );
g_Tiempo = get_gametime( )+180.0;
}
return PLUGIN_CONTINUE;
}
public send_post( iId, iType )
{
new Ip[ 42 ], Mensaje[ 128 ], szQuery[ 256 ];
get_user_ip( 0, Ip, charsmax( Ip ) );
if( iType == PCW )
{
new szPassword[ 128 ], iPass[ 128 ];
get_cvar_string( "sv_password", szPassword, charsmax( szPassword ) );
if( szPassword[ 0 ] )
formatex( iPass, charsmax( iPass ), "pass %s", szPassword );
formatex( Mensaje, charsmax( Mensaje ), "5 Team? %s %s", Ip, iPass );
}
else {
formatex( Mensaje, charsmax( Mensaje ), "Sale Mix %s", Ip);
}
new szFuid[ 64 ];
get_pcvar_string( cvar_fuid, szFuid, charsmax( szFuid ) );
replace_all( szFuid, charsmax( szFuid ), "^"", "" );
replace_all( szFuid, charsmax( szFuid ), "'", "" );
new szNombre[ 64 ];
get_pcvar_string( cvar_nombre, szNombre, charsmax( szNombre ) );
replace_all( szNombre, charsmax( szNombre ), "^"", "" );
replace_all( szNombre, charsmax( szNombre ), "'", "" );
formatex( szQuery, charsmax( szQuery ), "INSERT INTO %s (mensaje, fuid, ipmaster, nombre) VALUES ('%s', '%s', '%s', '%s')", g_szMysql[ MYSQL_TABLA ], Mensaje, szFuid, Ip, szNombre );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery );
}
public DataHandler( failstate, Handle:Query, error[], error2, data[], datasize, Float:time )
{
if( failstate < TQUERY_SUCCESS )
{
log_to_file( "SQL_DATEAR.log", "FAILSTATE=%d | ERROR=^"%s^" | ERROR2=%d", failstate, error, error2 );
printf( 0, "!g[CincoYA.net] !gError: %d - Informar contacto@cincoya.net", g_szPlugin[ P_PREFIJO ], error );
}
}
public printf( iId, const input[], any:... )
{
static szMsg[ 191 ], SayText;
if( !SayText )
SayText = get_user_msgid( "SayText" );
vformat( szMsg, charsmax( szMsg ), input, 3 );
replace_all( szMsg, charsmax( szMsg ), "!g", "^4" ), replace_all( szMsg, charsmax( szMsg ), "!y", "^1" ), replace_all( szMsg, charsmax( szMsg ), "!t", "^3" );
message_begin( iId ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, .player = iId );
write_byte( iId ? iId : 33 );
write_string( szMsg );
message_end( );
}
public MySQLx( )
{
g_hTuple = SQL_MakeDbTuple( g_szMysql[ MYSQL_HOST ], g_szMysql[ MYSQL_USER ], g_szMysql[ MYSQL_PASS ], g_szMysql[ MYSQL_DB ] );
if( !g_hTuple )
return pause( "a" );
return 1;
}
stock remove_quotes( Args[] )
{
static n;
if( !Args[ 0 ] )
return;
else if( Args[ 0 ] == 34 )
{
for( n = 1; ; n++ )
{
if( !Args[ n ] || Args[ n ] == 34 && !Args[ n+1 ] )
{
Args[ n-1 ] = 0;
break;
}
Args[ n-1 ] = Args[ n ];
}
}
else {
for( n = 1; ; n++ )
{
if( !Args[ n ] || Args[ n ] == 34 && !Args[ n+1 ] )
{
Args[ n ] = 0;
break;
}
}
}
}
public plugin_end( )
SQL_FreeHandle( g_hTuple );
PD: No publico el sistema web porque no es de mi autoria.