Plugins Consola (Solucionado)
#1
Hola gente, queria un plugin que al matar, ingresar, escribir y salir del server me aparezca en la consola de esta manera;
Código PHP:
Nombre"%s"SteamID"%s" - [ELIMINO ANombre"%s"SteamID"%s" - [Arma"%s"]

Nombre"%s"SteamID"%s" - [Ingreso al servidor]

Nombre"%s"SteamID"%s" - [Chat"%s"

Nombre"%s"SteamID"%s" - [Salio del servidor
Gracias  Excitedeyes
Responder
#2
(07/04/2022, 05:31 PM)Axon escribió: Hola gente, queria un plugin que al matar, ingresar, escribir y salir del server me aparezca en la consola de esta manera;
Código PHP:
Nombre"%s"SteamID"%s" - [ELIMINO ANombre"%s"SteamID"%s" - [Arma"%s"]

Nombre"%s"SteamID"%s" - [Ingreso al servidor]

Nombre"%s"SteamID"%s" - [Chat"%s"

Nombre"%s"SteamID"%s" - [Salio del servidor
Gracias  Excitedeyes

Código PHP:
#include <amxmodx>

#define PLUGIN "Console Log"
#define VERSION "1.0"
#define AUTHOR "Randro"


new const logs[] = "console.log";

new 
gPlayerName33 ][ 32 ], szSteam33 ][ 40 ];


public 
plugin_init()
{
    
register_pluginAUTHORVERSIONPLUGIN)

    
register_clcmd"say" "clcmdSay" );
    
register_clcmd"say_team" "clcmdSay" );

    
register_event("DeathMsg""event_death""a")
}


public 
client_putinserver(id)
{

    
get_user_nameid gPlayerName[id], 31 );
    
get_user_authididszSteam[id], charsmaxszSteam[] ) );

    
log_to_file(logs"Nombre: %s,  SteamID: %s - [Ingreso al Servidor]"gPlayerName[id], szSteam[id])

}

public 
client_disconnected(id)
{
    if(
is_user_bot(id))
        return;
    
log_to_file(logs"Nombre: %s,  SteamID: %s - [Salio del Servidor]"gPlayerName[id], szSteam[id])
}

public 
clcmdSay(id)
{
    static 
said[191]; read_args(said190); remove_quotes(said); replace_all(said190"%"""); replace_all(said190"#""");

    static 
color[11], prefix[128]; get_user_team(idcolor10);

    
formatex(prefix127"%s Nombre: %s SteamID: %s"is_user_alive(id)?" ":"^*DEAD* "gPlayerName[id], szSteam[id]);

    
format(saidcharsmax(said), "%s [Chat: %s]"prefixsaid);

    
log_to_file(logs"%s",  saidgPlayerName[id])

}

public 
event_death()
{
    static 
attackervictimweapon_name[10];
    
attacker read_data(1)
    
victim read_data(2)
    
read_data(4weapon_namecharsmax(weapon_name))

    if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim))
        return;
    
    
log_to_file(logs"Nombre: %s, SteamID: %s - [Elimino A] Nombre: %s, SteamID: %s - [Arma: %s]"gPlayerName[attacker], szSteam[attacker], gPlayerName[victim], szSteam[victim], weapon_name)



Archivos adjuntos
.sma   Descargar AMXX / console_log.sma (Tamaño: 1.72 KB / Descargas: 20)
Responder
#3
(07/04/2022, 09:48 PM)Randro escribió:
Código PHP:
#include <amxmodx>

#define PLUGIN "Console Log"
#define VERSION "1.0"
#define AUTHOR "Randro"


new const logs[] = "console.log";

new 
gPlayerName33 ][ 32 ], szSteam33 ][ 40 ];


public 
plugin_init()
{
 
register_pluginAUTHORVERSIONPLUGIN)

 
register_clcmd"say" "clcmdSay" );
 
register_clcmd"say_team" "clcmdSay" );

 
register_event("DeathMsg""event_death""a")
}


public 
client_putinserver(id)
{

 
get_user_nameid gPlayerName[id], 31 );
 
get_user_authididszSteam[id], charsmaxszSteam[] ) );

 
log_to_file(logs"Nombre: %s,  SteamID: %s - [Ingreso al Servidor]"gPlayerName[id], szSteam[id])

}

public 
client_disconnected(id)
{
 if(
is_user_bot(id))
 return;
 
log_to_file(logs"Nombre: %s,  SteamID: %s - [Salio del Servidor]"gPlayerName[id], szSteam[id])
}

public 
clcmdSay(id)
{
 static 
said[191]; read_args(said190); remove_quotes(said); replace_all(said190"%"""); replace_all(said190"#""");

 static 
color[11], prefix[128]; get_user_team(idcolor10);

 
formatex(prefix127"%s Nombre: %s SteamID: %s"is_user_alive(id)?"^x01":"^x01*DEAD* "gPlayerName[id], szSteam[id]);

 
format(saidcharsmax(said), "%s [Chat: %s]"prefixsaid);

 
log_to_file(logs"%s",  saidgPlayerName[id])

}

public 
event_death()
{
 static 
attackervictimweapon_name[10];
 
attacker read_data(1)
 
victim read_data(2)
 
read_data(4weapon_namecharsmax(weapon_name))

 if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim))
 return;
 
 
log_to_file(logs"Nombre: %s, SteamID: %s - [Elimino A] Nombre: %s, SteamID: %s - [Arma: %s]"gPlayerName[attacker], szSteam[attacker], gPlayerName[victim], szSteam[victim], weapon_name)


No hace falta que le agregues color a esto is_user_alive(id)?"^x01":"^x01*DEAD* " si es un log

Responder
#4
(08/04/2022, 02:44 AM)Skylar escribió: No hace falta que le agregues color a esto is_user_alive(id)?"^x01":"^x01*DEAD* " si es un log

cierto, se me olvido borrarlo
Responder
#5
GRACIAS! <3
Responder
#6
(08/04/2022, 02:44 AM)Skylar escribió: No hace falta que le agregues color a esto is_user_alive(id)?"^x01":"^x01*DEAD* " si es un log

Código PHP:
log_to_file(logs"%s",  saidgPlayerName[id]) 
------------>
Código PHP:
log_to_file(logssaid
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)