[BAN,KICK] COMO HAGO ESTO
#1
[Imagen: 41457211_322460358527358_541856518197634...e=5C3583AA]

como hago esto que esta en la siguiente imagen
cuando den kick o ban etc
Responder
#2
Código PHP:
//Sacado de mi amx viejo xD.
public cmdKick iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_KICK ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Razon 64 ];
    
read_argv 2Razonsizeof Razon ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    

    
    
SayPrint 0"%s ADMIN !g%s!y: expulsó al jugador !g%s !t| !yRazón: !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    
console_print iIndex"%s Jugador %s expulsado"PrefixConsoleg_PlayerName Target ] );
    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un bot^""get_user_userid Target ) );
    else { 
        if ( 
Razon ] )
            
server_cmd "kick #%d ^"%s^""get_user_userid Target ), Razon );
        else
            
server_cmd "kick #%d"get_user_userid Target ) );
    }
    
    
log_amx "Kick < ADMIN: %s expulso al jugador %s > < Razon ^"%s^" >"g_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    return 
PLUGIN_HANDLED;
    
}

stock SayPrint ( const iIndex, const Text [ ], any:... ) { 
    
    new 
Say 192 ];
    
vformat Saysizeof Say ), Text);
    
    
replace_all Saysizeof Say ), "!y""^1" );
    
replace_all Saysizeof Say ), "!g""^4" );
    
replace_all Saysizeof Say ), "!t""^3" );
    
    
//Acentos
    
replace_all Saysizeof Say ), "á""á" );
    
replace_all Saysizeof Say ), "é""é" );
    
replace_all Saysizeof Say ), "í""Ã*" );
    
replace_all Saysizeof Say ), "ó""ó" );
    
replace_all Saysizeof Say ), "ú""ú" );
    
replace_all Saysizeof Say ), "ñ""ñ" );
    
    
replace_all Saysizeof Say ), "Á""Ã" );
    
replace_all Saysizeof Say ), "É""É" );
    
replace_all Saysizeof Say ), "Í""Í" );
    
replace_all Saysizeof Say ), "Ó""Ó" );
    
replace_all Saysizeof Say ), "Ú""Ú" );
    
replace_all Saysizeof Say ), "Ñ""Ñ" );
    
    
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string Say );
    
message_end (  );
    
    

Responder
#3
(12/09/2018, 12:18 AM)Niper.-. escribió:
Código PHP:
//Sacado de mi amx viejo xD.
public cmdKick iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_KICK ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Razon 64 ];
    
read_argv 2Razonsizeof Razon ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    

    
    
SayPrint 0"%s ADMIN !g%s!y: expulsó al jugador !g%s !t| !yRazón: !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    
console_print iIndex"%s Jugador %s expulsado"PrefixConsoleg_PlayerName Target ] );
    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un bot^""get_user_userid Target ) );
    else { 
        if ( 
Razon ] )
            
server_cmd "kick #%d ^"%s^""get_user_userid Target ), Razon );
        else
            
server_cmd "kick #%d"get_user_userid Target ) );
    }
    
    
log_amx "Kick < ADMIN: %s expulso al jugador %s > < Razon ^"%s^" >"g_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    return 
PLUGIN_HANDLED;
    
}

stock SayPrint ( const iIndex, const Text [ ], any:... ) { 
    
    new 
Say 192 ];
    
vformat Saysizeof Say ), Text);
    
    
replace_all Saysizeof Say ), "!y""^1" );
    
replace_all Saysizeof Say ), "!g""^4" );
    
replace_all Saysizeof Say ), "!t""^3" );
    
    
//Acentos
    
replace_all Saysizeof Say ), "á""á" );
    
replace_all Saysizeof Say ), "é""é" );
    
replace_all Saysizeof Say ), "í""Ã*" );
    
replace_all Saysizeof Say ), "ó""ó" );
    
replace_all Saysizeof Say ), "ú""ú" );
    
replace_all Saysizeof Say ), "ñ""ñ" );
    
    
replace_all Saysizeof Say ), "Á""Ã" );
    
replace_all Saysizeof Say ), "É""É" );
    
replace_all Saysizeof Say ), "Í""Í" );
    
replace_all Saysizeof Say ), "Ó""Ó" );
    
replace_all Saysizeof Say ), "Ú""Ú" );
    
replace_all Saysizeof Say ), "Ñ""Ñ" );
    
    
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string Say );
    
message_end (  );
    
    


y para que tambien salga lo del ban?
que salga admin tata a baneado a loka por 10 minutos razon looco
Responder
#4
Sí.
Código PHP:
public cmdBan iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_BAN ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
        
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
TiempoBan 17 ];
    
read_argv 2TiempoBansizeof TiempoBan ) );
    
    new 
RazonBan 64 ];
    
read_argv 3RazonBansizeof RazonBan ) );
    
remove_quotes RazonBan );
    
trim RazonBan );
    
    
    
    if ( ( 
containi TargetPlayer"rcon_password" ) != -) || ( containi TargetPlayer";" ) != -) ||
    ( 
containi TiempoBan"rcon_password" ) != -) || ( containi TiempoBan";" ) != -) ||
    ( 
containi RazonBan"rcon_password" ) != -) || ( containi RazonBan";" ) != -) )  {
        
console_print iIndex"%s Que intentas hacer??"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) {
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    
    
    
    
SayPrint 0"%s ADMIN !g%s!y: banneo al jugador !g%s !t| !yRazón: !g%s !t| !yTiempo: !g%s%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], ( RazonBan ) ? RazonBan "No hubo razón del ban..", ( TiempoBan ] != '0' ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
    
    
console_print iIndex"%s El jugador %s fue banneado"PrefixConsoleg_PlayerName Target ] );
    
    new 
Ip 32 ], SteamID 32 ];
    
get_user_ip TargetIpsizeof Ip ), );
    
get_user_authid TargetSteamIDsizeof SteamID ) );
    
    new 
Fecha 35 ];
    
get_time "%d/%m/%Y - %H:%M:%S"Fecha34 );
    

    
PrintBanConsole Targetg_PlayerName Target ], IpRazonBanTiempoBanSteamIDFechag_PlayerName iIndex ] );
    

    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un BOT^"",  get_user_userid Target ) );
    else {
        
        
// | FECHA | ADMINISTRADOR | BANEADO | IP BANEADA | RAZON | TIEMPO        
        
log_to_file "zonaganjah_bans.txt""%s | %s | %s | %s | %s | %s"Fechag_PlayerName iIndex ], g_PlayerName Target ], Ip, ( RazonBan ) ? RazonBan "No hubo razon del ban..", ( TiempoBan ] != '0') ? TiempoBan "0" );
        
        if ( 
RazonBan ] )
            
server_cmd "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), RazonBanTiempoBanIp );
        else
            
server_cmd "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), TiempoBanIp );
            
        
    }
    
    
    
    
    return 
PLUGIN_HANDLED;

Responder
#5
(12/09/2018, 12:31 AM)Niper.-. escribió: Sí.
Código PHP:
public cmdBan iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_BAN ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
        
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
TiempoBan 17 ];
    
read_argv 2TiempoBansizeof TiempoBan ) );
    
    new 
RazonBan 64 ];
    
read_argv 3RazonBansizeof RazonBan ) );
    
remove_quotes RazonBan );
    
trim RazonBan );
    
    
    
    if ( ( 
containi TargetPlayer"rcon_password" ) != -) || ( containi TargetPlayer";" ) != -) ||
    ( 
containi TiempoBan"rcon_password" ) != -) || ( containi TiempoBan";" ) != -) ||
    ( 
containi RazonBan"rcon_password" ) != -) || ( containi RazonBan";" ) != -) )  {
        
console_print iIndex"%s Que intentas hacer??"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) {
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    
    
    
    
SayPrint 0"%s ADMIN !g%s!y: banneo al jugador !g%s !t| !yRazón: !g%s !t| !yTiempo: !g%s%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], ( RazonBan ) ? RazonBan "No hubo razón del ban..", ( TiempoBan ] != '0' ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
    
    
console_print iIndex"%s El jugador %s fue banneado"PrefixConsoleg_PlayerName Target ] );
    
    new 
Ip 32 ], SteamID 32 ];
    
get_user_ip TargetIpsizeof Ip ), );
    
get_user_authid TargetSteamIDsizeof SteamID ) );
    
    new 
Fecha 35 ];
    
get_time "%d/%m/%Y - %H:%M:%S"Fecha34 );
    

    
PrintBanConsole Targetg_PlayerName Target ], IpRazonBanTiempoBanSteamIDFechag_PlayerName iIndex ] );
    

    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un BOT^"",  get_user_userid Target ) );
    else {
        
        
// | FECHA | ADMINISTRADOR | BANEADO | IP BANEADA | RAZON | TIEMPO        
        
log_to_file "zonaganjah_bans.txt""%s | %s | %s | %s | %s | %s"Fechag_PlayerName iIndex ], g_PlayerName Target ], Ip, ( RazonBan ) ? RazonBan "No hubo razon del ban..", ( TiempoBan ] != '0') ? TiempoBan "0" );
        
        if ( 
RazonBan ] )
            
server_cmd "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), RazonBanTiempoBanIp );
        else
            
server_cmd "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), TiempoBanIp );
            
        
    }
    
    
    
    
    return 
PLUGIN_HANDLED;


Abra posibilidad de hacer todo junto en 1 solo plugins

Que tenga kick, ban y slay?

que cuando de slay tambien salga

admin taka a asesinado a loco razon afk camper lo que sea
Responder
#6
Yo ahí te deje todo bro, ahí te paso bien como sería y lo armas..
Al amx_slay le falta la razon, si esperas, mañana lo hago todo en uno, pero ahí ya estaría bien..
(Lo que podes hacer es en cmdSlay crear una nueva variable llamada "Razon"), luego usas, read_argv(2, Razon, charsmax(Razon)); y en el print editas y pondrias algo como..
"SayPrint(id, "Admin %s mato a %s por %s", variabl1, variable2, razon);"
plugin_init()
Código PHP:
register_clcmd "amx_kick""cmdKick"ADMIN_KICK" < Nombre , #UserID > < Razon >" );
register_clcmd "amx_slay""cmdSlay"ADMIN_SLAY" < Nombre , #UserID >" );
register_clcmd "amx_ban""cmdBan"ADMIN_BAN" < Nombre , #UserID > < Tiempo > < Razon >" ); 

CMDS
Código PHP:
public cmdKick iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_KICK ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Razon 64 ];
    
read_argv 2Razonsizeof Razon ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    

    
    
SayPrint 0"%s ADMIN !g%s!y: expulsó al jugador !g%s !t| !yRazón: !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    
console_print iIndex"%s Jugador %s expulsado"PrefixConsoleg_PlayerName Target ] );
    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un bot^""get_user_userid Target ) );
    else { 
        if ( 
Razon ] )
            
server_cmd "kick #%d ^"%s^""get_user_userid Target ), Razon );
        else
            
server_cmd "kick #%d"get_user_userid Target ) );
    }
    
    
log_amx "Kick < ADMIN: %s expulso al jugador %s > < Razon ^"%s^" >"g_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    return 
PLUGIN_HANDLED;
    
}

public 
cmdSlay iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_SLAY ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    if ( !
is_user_alive Target ) ) { 
        
console_print iIndex"%s El Jugador ^"%s^" esta muerto"PrefixConsoleg_PlayerName Target ] );
        return 
PLUGIN_HANDLED;
        
        
    }
    
    
    
SayPrint 0"%s ADMIN !g%s!y: mató al jugador !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ] );
    
    
    
user_kill Target );
    
    
log_amx "Slay < ADMIN: %s mato al jugador %s >"g_PlayerName iIndex ], g_PlayerName Target ] );
    
    return 
PLUGIN_HANDLED;
}


public 
cmdBan iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_BAN ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
            
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
TiempoBan 17 ];
    
read_argv 2TiempoBansizeof TiempoBan ) );
    
    new 
RazonBan 64 ];
    
read_argv 3RazonBansizeof RazonBan ) );
    
remove_quotes RazonBan );
        
trim RazonBan );
    
    
    
    if ( ( 
containi TargetPlayer"rcon_password" ) != -) || ( containi TargetPlayer";" ) != -) ||
    ( 
containi TiempoBan"rcon_password" ) != -) || ( containi TiempoBan";" ) != -) ||
    ( 
containi RazonBan"rcon_password" ) != -) || ( containi RazonBan";" ) != -) )  {
        
console_print iIndex"%s Que intentas hacer??"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) {
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    
    
    
    
SayPrint 0"%s ADMIN !g%s!y: banneo al jugador !g%s !t| !yRazón: !g%s !t| !yTiempo: !g%s%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], ( RazonBan ) ? RazonBan "No hubo razón del ban..", ( TiempoBan ] != '0' ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
    
    
console_print iIndex"%s El jugador %s fue banneado"PrefixConsoleg_PlayerName Target ] );
    
    new 
Ip 32 ], SteamID 32 ];
    
get_user_ip TargetIpsizeof Ip ), );
    
get_user_authid TargetSteamIDsizeof SteamID ) );
    
    new 
Fecha 35 ];
    
get_time "%d/%m/%Y - %H:%M:%S"Fecha34 );
    

    
PrintBanConsole Targetg_PlayerName Target ], IpRazonBanTiempoBanSteamIDFechag_PlayerName iIndex ] );
    

    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un BOT^"",  get_user_userid Target ) );
    else {
        
        
// | FECHA | ADMINISTRADOR | BANEADO | IP BANEADA | RAZON | TIEMPO        
        
log_to_file "zonaganjah_bans.txt""%s | %s | %s | %s | %s | %s"Fechag_PlayerName iIndex ], g_PlayerName Target ], Ip, ( RazonBan ) ? RazonBan "No hubo razon del ban..", ( TiempoBan ] != '0') ? TiempoBan "0" );
        
        if ( 
RazonBan ] )
            
server_cmd "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), RazonBanTiempoBanIp );
        else
            
server_cmd "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), TiempoBanIp );
            
        
    }
    
    
    
    
    return 
PLUGIN_HANDLED;


Variables
Código PHP:
//Prefix Say and Console
new const PrefixConsole [ ] = "[Zona-Ganjah]";
new const 
PrefixSay [ ] = "!g[ZG] -!y";

new 
g_PlayerName 33 ] [ 32 ]; 

client_putinserver
Código PHP:
get_user_name iIndexg_PlayerName iIndex ], sizeof g_PlayerName [ ] ) ); //Obtenemos el nombre a penas entra al server.. 

stocks
Código PHP:
PrintBanConsole ( const iIndex, const PlayerName [ ], const IP [ ], const RazonBan [ ], const TiempoBan [ ], const SteamID [ ], const Fecha [ ], const AdminName [ ] ) { 
    
//Consejo: Remplaza console_print por client_cmd. (Como tiene el Advanced Bans).
    
console_print iIndex"" );
    
console_print iIndex"****Zona-Ganjah****" );
    
console_print iIndex"Fuiste banneado del Servidor" );
    
console_print iIndex"Tu nombre: %s"PlayerName );
    
console_print iIndex"Tu IP: %s"IP );
    
console_print iIndex"La razon del ban fue: %s", ( RazonBan ) ? RazonBan "No hubo razon del ban.." );
    
console_print iIndex"Tiempo de ban: %s%s", ( TiempoBan ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
console_print iIndex"SteamID: %s"SteamID );
    
console_print iIndex"Fecha y Hora: %s"Fecha );
    
console_print iIndex"Fuiste banneado por: %s"AdminName );
    
console_print iIndex"****Zona-Ganjah****" );
    
console_print iIndex"" );
    
    
}
stock SayPrint ( const iIndex, const Text [ ], any:... ) { 
    
    new 
Say 192 ];
    
vformat Saysizeof Say ), Text);
    
    
replace_all Saysizeof Say ), "!y""^1" );
    
replace_all Saysizeof Say ), "!g""^4" );
    
replace_all Saysizeof Say ), "!t""^3" );
    
    
//Acentos
    
replace_all Saysizeof Say ), "á""á" );
    
replace_all Saysizeof Say ), "é""é" );
    
replace_all Saysizeof Say ), "í""Ã*" );
    
replace_all Saysizeof Say ), "ó""ó" );
    
replace_all Saysizeof Say ), "ú""ú" );
    
replace_all Saysizeof Say ), "ñ""ñ" );
    
    
replace_all Saysizeof Say ), "Á""Ã" );
    
replace_all Saysizeof Say ), "É""É" );
    
replace_all Saysizeof Say ), "Í""Í" );
    
replace_all Saysizeof Say ), "Ó""Ó" );
    
replace_all Saysizeof Say ), "Ú""Ú" );
    
replace_all Saysizeof Say ), "Ñ""Ñ" );
    
    
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string Say );
    
message_end (  );
    
    

Responder
#7
(12/09/2018, 12:50 AM)Niper.-. escribió: Yo ahí te deje todo bro, ahí te paso bien como sería y lo armas..

plugin_init()
Código PHP:
register_clcmd "amx_kick""cmdKick"ADMIN_KICK" < Nombre , #UserID > < Razon >" );
register_clcmd "amx_slay""cmdSlay"ADMIN_SLAY" < Nombre , #UserID >" );
register_clcmd "amx_ban""cmdBan"ADMIN_BAN" < Nombre , #UserID > < Tiempo > < Razon >" ); 

CMDS
Código PHP:
public cmdKick iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_KICK ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Razon 64 ];
    
read_argv 2Razonsizeof Razon ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    

    
    
SayPrint 0"%s ADMIN !g%s!y: expulsó al jugador !g%s !t| !yRazón: !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    
console_print iIndex"%s Jugador %s expulsado"PrefixConsoleg_PlayerName Target ] );
    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un bot^""get_user_userid Target ) );
    else { 
        if ( 
Razon ] )
            
server_cmd "kick #%d ^"%s^""get_user_userid Target ), Razon );
        else
            
server_cmd "kick #%d"get_user_userid Target ) );
    }
    
    
log_amx "Kick < ADMIN: %s expulso al jugador %s > < Razon ^"%s^" >"g_PlayerName iIndex ], g_PlayerName Target ], Razon );
    
    return 
PLUGIN_HANDLED;
    
}

public 
cmdSlay iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_SLAY ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
    
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) { 
        
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    if ( !
is_user_alive Target ) ) { 
        
console_print iIndex"%s El Jugador ^"%s^" esta muerto"PrefixConsoleg_PlayerName Target ] );
        return 
PLUGIN_HANDLED;
        
        
    }
    
    
    
SayPrint 0"%s ADMIN !g%s!y: mató al jugador !g%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ] );
    
    
    
user_kill Target );
    
    
log_amx "Slay < ADMIN: %s mato al jugador %s >"g_PlayerName iIndex ], g_PlayerName Target ] );
    
    return 
PLUGIN_HANDLED;
}


public 
cmdBan iIndex ) { 
    
    if ( ! ( 
get_user_flags iIndex ) & ADMIN_BAN ) ) {
            
console_print iIndex"%s No tienes acceso a este comando..."PrefixConsole ); 
            return 
PLUGIN_HANDLED;
            
    }
            
    new 
TargetPlayer 33 ];
    
read_argv 1TargetPlayersizeof TargetPlayer ) );
    
    new 
TiempoBan 17 ];
    
read_argv 2TiempoBansizeof TiempoBan ) );
    
    new 
RazonBan 64 ];
    
read_argv 3RazonBansizeof RazonBan ) );
    
remove_quotes RazonBan );
        
trim RazonBan );
    
    
    
    if ( ( 
containi TargetPlayer"rcon_password" ) != -) || ( containi TargetPlayer";" ) != -) ||
    ( 
containi TiempoBan"rcon_password" ) != -) || ( containi TiempoBan";" ) != -) ||
    ( 
containi RazonBan"rcon_password" ) != -) || ( containi RazonBan";" ) != -) )  {
        
console_print iIndex"%s Que intentas hacer??"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Target cmd_target iIndexTargetPlayer);
    
    if ( !
Target ) {
        
console_print iIndex"%s El Jugador no existe"PrefixConsole );
        return 
PLUGIN_HANDLED;
    }
    
    
    
    
    
SayPrint 0"%s ADMIN !g%s!y: banneo al jugador !g%s !t| !yRazón: !g%s !t| !yTiempo: !g%s%s"PrefixSayg_PlayerName iIndex ], g_PlayerName Target ], ( RazonBan ) ? RazonBan "No hubo razón del ban..", ( TiempoBan ] != '0' ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
    
    
console_print iIndex"%s El jugador %s fue banneado"PrefixConsoleg_PlayerName Target ] );
    
    new 
Ip 32 ], SteamID 32 ];
    
get_user_ip TargetIpsizeof Ip ), );
    
get_user_authid TargetSteamIDsizeof SteamID ) );
    
    new 
Fecha 35 ];
    
get_time "%d/%m/%Y - %H:%M:%S"Fecha34 );
    

    
PrintBanConsole Targetg_PlayerName Target ], IpRazonBanTiempoBanSteamIDFechag_PlayerName iIndex ] );
    

    
    if ( 
is_user_bot Target ) )
        
server_cmd "kick #%d ^"Eres un BOT^"",  get_user_userid Target ) );
    else {
        
        
// | FECHA | ADMINISTRADOR | BANEADO | IP BANEADA | RAZON | TIEMPO        
        
log_to_file "zonaganjah_bans.txt""%s | %s | %s | %s | %s | %s"Fechag_PlayerName iIndex ], g_PlayerName Target ], Ip, ( RazonBan ) ? RazonBan "No hubo razon del ban..", ( TiempoBan ] != '0') ? TiempoBan "0" );
        
        if ( 
RazonBan ] )
            
server_cmd "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), RazonBanTiempoBanIp );
        else
            
server_cmd "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip"get_user_userid Target ), TiempoBanIp );
            
        
    }
    
    
    
    
    return 
PLUGIN_HANDLED;


Variables
Código PHP:
//Prefix Say and Console
new const PrefixConsole [ ] = "[Zona-Ganjah]";
new const 
PrefixSay [ ] = "!g[ZG] -!y";

new 
g_PlayerName 33 ] [ 32 ]; 

client_putinserver
Código PHP:
get_user_name iIndexg_PlayerName iIndex ], sizeof g_PlayerName [ ] ) ); //Obtenemos el nombre a penas entra al server.. 

stocks
Código PHP:
PrintBanConsole ( const iIndex, const PlayerName [ ], const IP [ ], const RazonBan [ ], const TiempoBan [ ], const SteamID [ ], const Fecha [ ], const AdminName [ ] ) { 
    
//Consejo: Remplaza console_print por client_cmd. (Como tiene el Advanced Bans).
    
console_print iIndex"" );
    
console_print iIndex"****Zona-Ganjah****" );
    
console_print iIndex"Fuiste banneado del Servidor" );
    
console_print iIndex"Tu nombre: %s"PlayerName );
    
console_print iIndex"Tu IP: %s"IP );
    
console_print iIndex"La razon del ban fue: %s", ( RazonBan ) ? RazonBan "No hubo razon del ban.." );
    
console_print iIndex"Tiempo de ban: %s%s", ( TiempoBan ) ? TiempoBan "Permanente", ( TiempoBan ] != '0') ? " minutos" "" );
    
console_print iIndex"SteamID: %s"SteamID );
    
console_print iIndex"Fecha y Hora: %s"Fecha );
    
console_print iIndex"Fuiste banneado por: %s"AdminName );
    
console_print iIndex"****Zona-Ganjah****" );
    
console_print iIndex"" );
    
    
}
stock SayPrint ( const iIndex, const Text [ ], any:... ) { 
    
    new 
Say 192 ];
    
vformat Saysizeof Say ), Text);
    
    
replace_all Saysizeof Say ), "!y""^1" );
    
replace_all Saysizeof Say ), "!g""^4" );
    
replace_all Saysizeof Say ), "!t""^3" );
    
    
//Acentos
    
replace_all Saysizeof Say ), "á""á" );
    
replace_all Saysizeof Say ), "é""é" );
    
replace_all Saysizeof Say ), "í""Ã*" );
    
replace_all Saysizeof Say ), "ó""ó" );
    
replace_all Saysizeof Say ), "ú""ú" );
    
replace_all Saysizeof Say ), "ñ""ñ" );
    
    
replace_all Saysizeof Say ), "Á""Ã" );
    
replace_all Saysizeof Say ), "É""É" );
    
replace_all Saysizeof Say ), "Í""Í" );
    
replace_all Saysizeof Say ), "Ó""Ó" );
    
replace_all Saysizeof Say ), "Ú""Ú" );
    
replace_all Saysizeof Say ), "Ñ""Ñ" );
    
    
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string Say );
    
message_end (  );
    
    


por favor si puedes hacerlo porfa es que no entiendo muy bien esto porfa solo te pido eso!
Responder
#8
Le das la mano y te agarra la nariz

Responder
#9
Dedo arriba 
¿Quien hace sma a la ves? Osea: Ban.sma | Kick.sma...| No entiendo nada :'v, por favol
Responder
#10
reemplaza las funciones en admincmd.sma
Responder
#11
Triste 
Nelo, solo que yo no entiendo mucho eso :c, por eso les dije del sma :c
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)