Mensajes: 8
Temas: 2
Registro en: Sep 2018
Reputación:
0
como hago esto que esta en la siguiente imagen
cuando den kick o ban etc
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
12/09/2018, 12:18 AM
(Última modificación: 12/09/2018, 12:20 AM por Niper.-..)
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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Razon [ 64 ]; read_argv ( 2, Razon, sizeof ( Razon ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Razon ); console_print ( iIndex, "%s Jugador %s expulsado", PrefixConsole, g_PlayerName [ Target ] ); if ( is_user_bot ( Target ) ) server_cmd ( "kick #%d ^"Eres un bot^"", get_user_userid ( Target ) ); else { if ( Razon [ 0 ] ) 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 ( Say, sizeof ( Say ), Text, 3 ); replace_all ( Say, sizeof ( Say ), "!y", "^1" ); replace_all ( Say, sizeof ( Say ), "!g", "^4" ); replace_all ( Say, sizeof ( Say ), "!t", "^3" ); //Acentos replace_all ( Say, sizeof ( Say ), "á", "á" ); replace_all ( Say, sizeof ( Say ), "é", "é" ); replace_all ( Say, sizeof ( Say ), "í", "Ã*" ); replace_all ( Say, sizeof ( Say ), "ó", "ó" ); replace_all ( Say, sizeof ( Say ), "ú", "ú" ); replace_all ( Say, sizeof ( Say ), "ñ", "ñ" ); replace_all ( Say, sizeof ( Say ), "Á", "Ã" ); replace_all ( Say, sizeof ( Say ), "É", "É" ); replace_all ( Say, sizeof ( Say ), "Í", "Ã" ); replace_all ( Say, sizeof ( Say ), "Ó", "Ó" ); replace_all ( Say, sizeof ( Say ), "Ú", "Ú" ); replace_all ( Say, sizeof ( Say ), "Ñ", "Ñ" ); message_begin ( iIndex ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, get_user_msgid ( "SayText" ), .player = iIndex ); write_byte ( iIndex ? iIndex : 33 ); write_string ( Say ); message_end ( ); }
Mensajes: 8
Temas: 2
Registro en: Sep 2018
Reputación:
0
(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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Razon [ 64 ]; read_argv ( 2, Razon, sizeof ( Razon ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Razon ); console_print ( iIndex, "%s Jugador %s expulsado", PrefixConsole, g_PlayerName [ Target ] ); if ( is_user_bot ( Target ) ) server_cmd ( "kick #%d ^"Eres un bot^"", get_user_userid ( Target ) ); else { if ( Razon [ 0 ] ) 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 ( Say, sizeof ( Say ), Text, 3 ); replace_all ( Say, sizeof ( Say ), "!y", "^1" ); replace_all ( Say, sizeof ( Say ), "!g", "^4" ); replace_all ( Say, sizeof ( Say ), "!t", "^3" ); //Acentos replace_all ( Say, sizeof ( Say ), "á", "á" ); replace_all ( Say, sizeof ( Say ), "é", "é" ); replace_all ( Say, sizeof ( Say ), "í", "Ã*" ); replace_all ( Say, sizeof ( Say ), "ó", "ó" ); replace_all ( Say, sizeof ( Say ), "ú", "ú" ); replace_all ( Say, sizeof ( Say ), "ñ", "ñ" ); replace_all ( Say, sizeof ( Say ), "Á", "Ã" ); replace_all ( Say, sizeof ( Say ), "É", "É" ); replace_all ( Say, sizeof ( Say ), "Í", "Ã" ); replace_all ( Say, sizeof ( Say ), "Ó", "Ó" ); replace_all ( Say, sizeof ( Say ), "Ú", "Ú" ); replace_all ( Say, sizeof ( Say ), "Ñ", "Ñ" ); message_begin ( iIndex ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, get_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
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new TiempoBan [ 17 ]; read_argv ( 2, TiempoBan, sizeof ( TiempoBan ) ); new RazonBan [ 64 ]; read_argv ( 3, RazonBan, sizeof ( RazonBan ) ); remove_quotes ( RazonBan ); trim ( RazonBan ); if ( ( containi ( TargetPlayer, "rcon_password" ) != -1 ) || ( containi ( TargetPlayer, ";" ) != -1 ) || ( containi ( TiempoBan, "rcon_password" ) != -1 ) || ( containi ( TiempoBan, ";" ) != -1 ) || ( containi ( RazonBan, "rcon_password" ) != -1 ) || ( containi ( RazonBan, ";" ) != -1 ) ) { console_print ( iIndex, "%s Que intentas hacer??", PrefixConsole ); return PLUGIN_HANDLED; } new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], ( RazonBan ) ? RazonBan : "No hubo razón del ban..", ( TiempoBan [ 0 ] != '0' ) ? TiempoBan : "Permanente", ( TiempoBan [ 0 ] != '0') ? " minutos" : "" ); console_print ( iIndex, "%s El jugador %s fue banneado", PrefixConsole, g_PlayerName [ Target ] ); new Ip [ 32 ], SteamID [ 32 ]; get_user_ip ( Target, Ip, sizeof ( Ip ), 0 ); get_user_authid ( Target, SteamID, sizeof ( SteamID ) ); new Fecha [ 35 ]; get_time ( "%d/%m/%Y - %H:%M:%S", Fecha, 34 );
PrintBanConsole ( Target, g_PlayerName [ Target ], Ip, RazonBan, TiempoBan, SteamID, Fecha, g_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", Fecha, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Ip, ( RazonBan ) ? RazonBan : "No hubo razon del ban..", ( TiempoBan [ 0 ] != '0') ? TiempoBan : "0" ); if ( RazonBan [ 0 ] ) server_cmd ( "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), RazonBan, TiempoBan, Ip ); else server_cmd ( "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), TiempoBan, Ip ); } return PLUGIN_HANDLED; }
Mensajes: 8
Temas: 2
Registro en: Sep 2018
Reputación:
0
(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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new TiempoBan [ 17 ]; read_argv ( 2, TiempoBan, sizeof ( TiempoBan ) ); new RazonBan [ 64 ]; read_argv ( 3, RazonBan, sizeof ( RazonBan ) ); remove_quotes ( RazonBan ); trim ( RazonBan ); if ( ( containi ( TargetPlayer, "rcon_password" ) != -1 ) || ( containi ( TargetPlayer, ";" ) != -1 ) || ( containi ( TiempoBan, "rcon_password" ) != -1 ) || ( containi ( TiempoBan, ";" ) != -1 ) || ( containi ( RazonBan, "rcon_password" ) != -1 ) || ( containi ( RazonBan, ";" ) != -1 ) ) { console_print ( iIndex, "%s Que intentas hacer??", PrefixConsole ); return PLUGIN_HANDLED; } new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], ( RazonBan ) ? RazonBan : "No hubo razón del ban..", ( TiempoBan [ 0 ] != '0' ) ? TiempoBan : "Permanente", ( TiempoBan [ 0 ] != '0') ? " minutos" : "" ); console_print ( iIndex, "%s El jugador %s fue banneado", PrefixConsole, g_PlayerName [ Target ] ); new Ip [ 32 ], SteamID [ 32 ]; get_user_ip ( Target, Ip, sizeof ( Ip ), 0 ); get_user_authid ( Target, SteamID, sizeof ( SteamID ) ); new Fecha [ 35 ]; get_time ( "%d/%m/%Y - %H:%M:%S", Fecha, 34 );
PrintBanConsole ( Target, g_PlayerName [ Target ], Ip, RazonBan, TiempoBan, SteamID, Fecha, g_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", Fecha, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Ip, ( RazonBan ) ? RazonBan : "No hubo razon del ban..", ( TiempoBan [ 0 ] != '0') ? TiempoBan : "0" ); if ( RazonBan [ 0 ] ) server_cmd ( "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), RazonBan, TiempoBan, Ip ); else server_cmd ( "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), TiempoBan, Ip ); } 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
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
12/09/2018, 12:50 AM
(Última modificación: 12/09/2018, 12:54 AM por Niper.-..)
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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Razon [ 64 ]; read_argv ( 2, Razon, sizeof ( Razon ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Razon ); console_print ( iIndex, "%s Jugador %s expulsado", PrefixConsole, g_PlayerName [ Target ] ); if ( is_user_bot ( Target ) ) server_cmd ( "kick #%d ^"Eres un bot^"", get_user_userid ( Target ) ); else { if ( Razon [ 0 ] ) 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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixConsole, g_PlayerName [ Target ] ); return PLUGIN_HANDLED; } SayPrint ( 0, "%s ADMIN !g%s!y: mató al jugador !g%s", PrefixSay, g_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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new TiempoBan [ 17 ]; read_argv ( 2, TiempoBan, sizeof ( TiempoBan ) ); new RazonBan [ 64 ]; read_argv ( 3, RazonBan, sizeof ( RazonBan ) ); remove_quotes ( RazonBan ); trim ( RazonBan ); if ( ( containi ( TargetPlayer, "rcon_password" ) != -1 ) || ( containi ( TargetPlayer, ";" ) != -1 ) || ( containi ( TiempoBan, "rcon_password" ) != -1 ) || ( containi ( TiempoBan, ";" ) != -1 ) || ( containi ( RazonBan, "rcon_password" ) != -1 ) || ( containi ( RazonBan, ";" ) != -1 ) ) { console_print ( iIndex, "%s Que intentas hacer??", PrefixConsole ); return PLUGIN_HANDLED; } new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], ( RazonBan ) ? RazonBan : "No hubo razón del ban..", ( TiempoBan [ 0 ] != '0' ) ? TiempoBan : "Permanente", ( TiempoBan [ 0 ] != '0') ? " minutos" : "" ); console_print ( iIndex, "%s El jugador %s fue banneado", PrefixConsole, g_PlayerName [ Target ] ); new Ip [ 32 ], SteamID [ 32 ]; get_user_ip ( Target, Ip, sizeof ( Ip ), 0 ); get_user_authid ( Target, SteamID, sizeof ( SteamID ) ); new Fecha [ 35 ]; get_time ( "%d/%m/%Y - %H:%M:%S", Fecha, 34 );
PrintBanConsole ( Target, g_PlayerName [ Target ], Ip, RazonBan, TiempoBan, SteamID, Fecha, g_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", Fecha, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Ip, ( RazonBan ) ? RazonBan : "No hubo razon del ban..", ( TiempoBan [ 0 ] != '0') ? TiempoBan : "0" ); if ( RazonBan [ 0 ] ) server_cmd ( "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), RazonBan, TiempoBan, Ip ); else server_cmd ( "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), TiempoBan, Ip ); } 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 ( iIndex, g_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 ] != '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 ( Say, sizeof ( Say ), Text, 3 ); replace_all ( Say, sizeof ( Say ), "!y", "^1" ); replace_all ( Say, sizeof ( Say ), "!g", "^4" ); replace_all ( Say, sizeof ( Say ), "!t", "^3" ); //Acentos replace_all ( Say, sizeof ( Say ), "á", "á" ); replace_all ( Say, sizeof ( Say ), "é", "é" ); replace_all ( Say, sizeof ( Say ), "í", "Ã*" ); replace_all ( Say, sizeof ( Say ), "ó", "ó" ); replace_all ( Say, sizeof ( Say ), "ú", "ú" ); replace_all ( Say, sizeof ( Say ), "ñ", "ñ" ); replace_all ( Say, sizeof ( Say ), "Á", "Ã" ); replace_all ( Say, sizeof ( Say ), "É", "É" ); replace_all ( Say, sizeof ( Say ), "Í", "Ã" ); replace_all ( Say, sizeof ( Say ), "Ó", "Ó" ); replace_all ( Say, sizeof ( Say ), "Ú", "Ú" ); replace_all ( Say, sizeof ( Say ), "Ñ", "Ñ" ); message_begin ( iIndex ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, get_user_msgid ( "SayText" ), .player = iIndex ); write_byte ( iIndex ? iIndex : 33 ); write_string ( Say ); message_end ( ); }
Mensajes: 8
Temas: 2
Registro en: Sep 2018
Reputación:
0
(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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Razon [ 64 ]; read_argv ( 2, Razon, sizeof ( Razon ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Razon ); console_print ( iIndex, "%s Jugador %s expulsado", PrefixConsole, g_PlayerName [ Target ] ); if ( is_user_bot ( Target ) ) server_cmd ( "kick #%d ^"Eres un bot^"", get_user_userid ( Target ) ); else { if ( Razon [ 0 ] ) 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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixConsole, g_PlayerName [ Target ] ); return PLUGIN_HANDLED; } SayPrint ( 0, "%s ADMIN !g%s!y: mató al jugador !g%s", PrefixSay, g_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 ( 1, TargetPlayer, sizeof ( TargetPlayer ) ); new TiempoBan [ 17 ]; read_argv ( 2, TiempoBan, sizeof ( TiempoBan ) ); new RazonBan [ 64 ]; read_argv ( 3, RazonBan, sizeof ( RazonBan ) ); remove_quotes ( RazonBan ); trim ( RazonBan ); if ( ( containi ( TargetPlayer, "rcon_password" ) != -1 ) || ( containi ( TargetPlayer, ";" ) != -1 ) || ( containi ( TiempoBan, "rcon_password" ) != -1 ) || ( containi ( TiempoBan, ";" ) != -1 ) || ( containi ( RazonBan, "rcon_password" ) != -1 ) || ( containi ( RazonBan, ";" ) != -1 ) ) { console_print ( iIndex, "%s Que intentas hacer??", PrefixConsole ); return PLUGIN_HANDLED; } new Target = cmd_target ( iIndex, TargetPlayer, 3 ); 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", PrefixSay, g_PlayerName [ iIndex ], g_PlayerName [ Target ], ( RazonBan ) ? RazonBan : "No hubo razón del ban..", ( TiempoBan [ 0 ] != '0' ) ? TiempoBan : "Permanente", ( TiempoBan [ 0 ] != '0') ? " minutos" : "" ); console_print ( iIndex, "%s El jugador %s fue banneado", PrefixConsole, g_PlayerName [ Target ] ); new Ip [ 32 ], SteamID [ 32 ]; get_user_ip ( Target, Ip, sizeof ( Ip ), 0 ); get_user_authid ( Target, SteamID, sizeof ( SteamID ) ); new Fecha [ 35 ]; get_time ( "%d/%m/%Y - %H:%M:%S", Fecha, 34 );
PrintBanConsole ( Target, g_PlayerName [ Target ], Ip, RazonBan, TiempoBan, SteamID, Fecha, g_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", Fecha, g_PlayerName [ iIndex ], g_PlayerName [ Target ], Ip, ( RazonBan ) ? RazonBan : "No hubo razon del ban..", ( TiempoBan [ 0 ] != '0') ? TiempoBan : "0" ); if ( RazonBan [ 0 ] ) server_cmd ( "kick #%d ^"%s^"; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), RazonBan, TiempoBan, Ip ); else server_cmd ( "kick #%d; wait; addip ^"%s^" ^"%s^"; wait; writeip", get_user_userid ( Target ), TiempoBan, Ip ); } 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 ( iIndex, g_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 ] != '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 ( Say, sizeof ( Say ), Text, 3 ); replace_all ( Say, sizeof ( Say ), "!y", "^1" ); replace_all ( Say, sizeof ( Say ), "!g", "^4" ); replace_all ( Say, sizeof ( Say ), "!t", "^3" ); //Acentos replace_all ( Say, sizeof ( Say ), "á", "á" ); replace_all ( Say, sizeof ( Say ), "é", "é" ); replace_all ( Say, sizeof ( Say ), "í", "Ã*" ); replace_all ( Say, sizeof ( Say ), "ó", "ó" ); replace_all ( Say, sizeof ( Say ), "ú", "ú" ); replace_all ( Say, sizeof ( Say ), "ñ", "ñ" ); replace_all ( Say, sizeof ( Say ), "Á", "Ã" ); replace_all ( Say, sizeof ( Say ), "É", "É" ); replace_all ( Say, sizeof ( Say ), "Í", "Ã" ); replace_all ( Say, sizeof ( Say ), "Ó", "Ó" ); replace_all ( Say, sizeof ( Say ), "Ú", "Ú" ); replace_all ( Say, sizeof ( Say ), "Ñ", "Ñ" ); message_begin ( iIndex ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, get_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!
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
12/09/2018, 02:13 PM
(Última modificación: 12/09/2018, 02:13 PM por Skylar.)
Le das la mano y te agarra la nariz
Mensajes: 33
Temas: 8
Registro en: Nov 2016
Reputación:
0
26/09/2018, 06:43 PM
¿Quien hace sma a la ves? Osea: Ban.sma | Kick.sma...| No entiendo nada :'v, por favol
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
reemplaza las funciones en admincmd.sma
Mensajes: 33
Temas: 8
Registro en: Nov 2016
Reputación:
0
27/09/2018, 01:56 AM
Nelo, solo que yo no entiendo mucho eso :c, por eso les dije del sma :c
|