[TTT] Pedido de PL.
#1
Hola a todos, soy nuevo en alliedmodders este es mi primer post! necesito ver si me pueden ayudar con varias cositas que me faltan para el TTT, ya que de a poco lo voy terminando de configurar, los plugins siguiente que necesito son:

1º: Cuando el "Detective" analiza un cadáver o cuerpo muerto le quede el "Glow" dependiendo lo que ese player sea inocente, traidor o detective. No se si me explico bien.
Ejemplo le dejo esta imagen Sonrisa
[Imagen: 13115807_1016853441731354_1824541065_n.p...e=572D48E4]

2º: Necesito que la "Golden"(dorada) Del detective, marque a una player y que al tirarle la dorada no lo mate solamente lo marque y les aparezca en el say a todo el servidor. Por ejemplo:
Fulanito fue probado Traidor por Detective Pepito, entonces yo busco ese PL para poder saber cuando hacen FS, si es inocente o traidor.

3º: Necesito si alguien me puede ayudar con el sistema de Ban por "x" Karma, ya que en el que tengo en mi servidor solamente da "Kick" y lo he cambiado para que banee, pero no logro hacerlo funcionar si alguien me ayuda o me da una mano se lo agradecería mucho.

Muchas Gracias!
Responder
#2
pacman fijate que hay una cvar para lo del karma, no lo tenes puesto al parecer, tiene flags.

PD: Lo del TTT de Zg me llevo tiempito hacerlo (aviso)
Responder
#3
Lo he probado con las cvar, modificando el sma, tambien en ttt_mod.cfg pero no no logre hacerlo funcionar de ninguna manera.
Responder
#4
revisa imbox te puedo ayudar

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <ttt>

new g_iCached[2], g_iKilledWho[33][33], g_pCommandMenuID1g_pCommandMenuID2g_iPlayerStates[33][2];
new const 
g_szIconNames[][] = 
{
    
"suicide""p228""""scout""hegrenade""xm1014""c4""mac10""aug""hegrenade""elite""fiveseven",
    
"ump45""sg550""galil""famas""usp""glock18""awp""mp5navy""m249""m3""m4a1""tmp""g3sg1""hegrenade",
    
"deagle""sg552""ak47""crowbar""p90""0""1""2""3"
};

new const 
g_szColors[][] = 
{
    
"#848284"// grey
    
"#fc0204"// red
    
"#0402fc"// blue
    
"#048204"// green
    
"#E211F5"// purple
    
"#F57011"  // orange
};

public 
plugin_precache()
{
    static 
icon[32];
    for(new 
0<= charsmax(g_szIconNames); i++)
    {
        if(
&& strlen(g_szIconNames[i]) < 3) continue;
        
formatex(iconcharsmax(icon), "gfx/ttt/%s.gif"g_szIconNames[i]);
        
precache_generic(icon);
    }
}

public 
plugin_init()
{
    
register_plugin("[TTT] Show infos"TTT_VERSIONTTT_AUTHOR);

    
// register_clcmd("say /tttme", "ttt_show_me");
    // register_clcmd("say_team /tttme", "ttt_show_me");
    
g_pCommandMenuID1 ttt_command_add("/me");
    
g_pCommandMenuID2 ttt_command_add("Last states");

    
RegisterHamPlayer(Ham_Killed"Ham_Killed_post"1);
}

public 
ttt_command_selected(idmenuidname[])
{
    if(
g_pCommandMenuID1 == menuid)
        
ttt_show_me(id);
    else if(
g_pCommandMenuID2 == menuid)
        
show_last_states(id);
}

public 
ttt_gamemode(gamemode)
{
    if(
gamemode == GAME_PREPARING || gamemode == GAME_RESTARTING || gamemode == GAME_STARTED)
    {
        new 
numid;
        static 
players[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
id players[num];
            
reset_player(id);
            if(
gamemode == GAME_STARTED)
                
swap_player_states(id);
        }

        if(
gamemode == GAME_STARTED)
            
g_iCached[1] = false;
    }
}

public 
client_putinserver(id)
{
    
g_iPlayerStates[id][0] = -1;
    
g_iPlayerStates[id][1] = -1;
    
reset_player(idid);
}

stock swap_player_states(id)
{
    
g_iPlayerStates[id][0] = g_iPlayerStates[id][1];
    
g_iPlayerStates[id][1] = ttt_get_playerstate(id);
}

stock reset_player(idother 0)
{
    new 
numplayer;
    static 
players[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
player players[num];
        
g_iKilledWho[id][player] = false;
        if(
other)
        {
            
g_iKilledWho[player][id] = false;
        }
    }
}

public 
ttt_winner(team)
{
    
g_iCached[0] = false;
    
g_iCached[1] = false;
    new 
numid;
    static 
players[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
id players[num];
        
client_cmd(id"-attack");
        
client_cmd(id"-attack2");
        
show_motd_winner(id);
    }
}

public 
ttt_showinfo(idtarget)
{
    new 
mode ttt_get_gamemode(); 
    if(!
is_user_alive(target) && is_user_alive(id) &&  mode != GAME_ENDED && mode != GAME_OFF)
    {
        new 
named[32], namev[32];
        
get_user_name(idnamedcharsmax(named));
        
get_user_name(targetnamevcharsmax(namev));
        
client_print_color(0print_team_default,"[!gTTT!n]: !t%s !nha inspeccionado a !g%s !n[!t%L!n]"namednamevidspecial_names[ttt_get_alivestate(target)]); // by thom1
        
show_motd_info(idtarget);
    }
}

public 
ttt_show_me(id)
{
    if(
ttt_get_gamemode() == GAME_OFF)
        return;

    if(!
is_user_alive(id))
    {
        const 
SIZE 1536;
        static 
msg[SIZE+1];
        new 
len;

        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 no-repeat center top;}</style></head><body>");
        
len += formatex(msg[len], SIZE len"</br><center><h2>%L</h2></center>"id"TTT_WINNER_LINE7");

        new 
numplayercountalive_state;
        static 
players[32], name[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
player players[num];
            if(
g_iKilledWho[id][player])
            {
                
count++;
                
alive_state ttt_get_alivestate(player);
                
get_user_name(playernamecharsmax(name));
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>[%L] %s</b></br>"g_szColors[alive_state], idspecial_names[alive_state], name);
            }
        }

        if(!
countlen += formatex(msg[len], SIZE len"%L"id"TTT_WINNER_LINE6");
        
len += formatex(msg[len], SIZE len"</body></html>");

        
show_motd(idmsg"");
    }
    else 
client_print_color(idprint_team_default"%s %L"TTT_TAGid"TTT_ALIVE");
}

public 
Ham_Killed_post(victimkillershouldgib)
{
    if(!
is_user_connected(killer))
        
killer ttt_find_valid_killer(victimkiller);

    if(!
is_user_connected(killer) || ttt_get_gamemode() == GAME_ENDED)
        return 
HAM_IGNORED;

    
g_iKilledWho[killer][victim] = ttt_get_alivestate(victim);
    return 
HAM_HANDLED;
}

public 
show_motd_winner(id)
{
    if(!
is_user_connected(id) || ttt_get_gamemode() == GAME_OFF)
        return;

    const 
SIZE 1536;
    static 
wholemsg[SIZE+1], msg[SIZE+1], motdname[64], staticsize;
    new 
zumlen;
    if(!
g_iCached[0])
    {
        new 
ihighestnumkilledstatecurrentstate;
        new 
name[32], Traitors[256], Detectives[256], suicide[128], kills[128], c4[70], out[64], players[32];

        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
players[num];

            
killedstate ttt_get_alivestate(i);
            
currentstate ttt_get_playerstate(i);
            
get_user_name(inamecharsmax(name));

            if(
currentstate == PC_TRAITOR || killedstate == PC_TRAITOR)
                
format(Traitorscharsmax(Traitors), "%s, %s"nameTraitors);

            if(
currentstate == PC_DETECTIVE || killedstate == PC_DETECTIVE)
                
format(Detectivescharsmax(Detectives), "%s, %s"nameDetectives);

            if(
ttt_get_playerdata(iPD_KILLEDBY) == 3005)
                
format(suicidecharsmax(suicide), "%s, %s"namesuicide);

            if(
ttt_get_playerdata(iPD_C4EXPLODED))
                
format(c4charsmax(c4), "%s, %s"namec4);

            if(
ttt_get_playerdata(iPD_KILLCOUNT) > highest)
            {
                if(
currentstate != PC_DEAD)
                    
zum currentstate;
                else 
zum killedstate;

                
highest ttt_get_playerdata(iPD_KILLCOUNT);
                
formatex(killscharsmax(kills), "%L"LANG_SERVER"TTT_WINNER_LINE4"g_szColors[zum], LANG_SERVERspecial_names[zum], namehighest);
            }
        }

        if(
strlen(Traitors) > 2)
            
Traitors[strlen(Traitors)-2] = '^0';

        if(
strlen(Detectives) > 2)
            
Detectives[strlen(Detectives)-2] = '^0';

        if(
strlen(suicide) > 2)
            
suicide[strlen(suicide)-2] = '^0';

        if(
strlen(c4) > 2)
            
c4[strlen(c4)-2] = '^0';

        new 
winner ttt_get_winner();
        if(
winner == PC_DETECTIVE)
            
winner++;

        if(
winner == PC_TRAITOR)
            
formatex(outcharsmax(out), "%L"LANG_SERVER"TTT_TWIN");
        else if(
winner == PC_INNOCENT)
            
formatex(outcharsmax(out), "%L"LANG_SERVER"TTT_IWIN");

        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 url('gfx/ttt/%d.gif') no-repeat center top;}</style></head><body>"winner);
        
len += formatex(msg[len], SIZE len"</br><center><h1>%s</h1></center>"out);

        if(
strlen(Detectives) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %s</b><br/>"g_szColors[PC_DETECTIVE], LANG_SERVERspecial_names[PC_DETECTIVE], Detectives);
        
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %s</b><br/><br/>"g_szColors[PC_TRAITOR], LANG_SERVERspecial_names[PC_TRAITOR], Traitors);

        if(
strlen(kills) > 0)
            
len += formatex(msg[len], SIZE len"%s<br/>"kills);

        if(
strlen(suicide) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L<br/>"g_szColors[PC_SPECIAL], LANG_SERVER"TTT_WINNER_LINE2"suicide);

        if(
strlen(c4) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L<br/>"g_szColors[PC_SPECIAL], LANG_SERVER"TTT_WINNER_LINE3"c4);

        
formatex(motdnamecharsmax(motdname), "%L"LANG_SERVER"TTT_WINNER_LINE1");
        
g_iCached[0] = true;
        
staticsize len;
    }
    
len staticsize;
    
formatex(wholemsgcharsmax(msg), "%s"msg);

    
// len += formatex(wholemsg[len], SIZE - len, "%L</br>", LANG_SERVER, "TTT_WINNER_LINE7");
    
new numplayercountalive_state;
    static 
players[32], name[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
player players[num];
        if(
g_iKilledWho[id][player])
        {
            
count++;
            
alive_state ttt_get_alivestate(player);
            
get_user_name(playernamecharsmax(name));
            
len += formatex(wholemsg[len], SIZE len"%L <b style='color:%s'>[%L] %s</b></br>"LANG_SERVER"TTT_WINNER_LINE7"g_szColors[alive_state], LANG_SERVERspecial_names[alive_state], name);
        }
    }

    if(!
countformatex(wholemsg[len], SIZE len"%L"id"TTT_WINNER_LINE6");
    
    new 
karma ttt_get_playerdata(idPD_KARMA), karmatemp ttt_get_playerdata(idPD_KARMATEMP);
    
zum ttt_get_alivestate(id);
    
len += formatex(wholemsg[len], SIZE len"%L<br/>"LANG_SERVER"TTT_WINNER_LINE5"g_szColors[zum], karmag_szColors[zum], karmatemp-karmag_szColors[zum], karmatemp);
    
len += formatex(wholemsg[len], SIZE len"</body></html>");

    
show_motd(idwholemsgmotdname);
    
wholemsg[0] = '^0';
}

public 
show_motd_info(idtarget)
{
    static 
name[2][32], killmsg[64];
    
get_user_name(targetname[0], charsmax(name[]));
    new 
minutes = (ttt_get_playerdata(targetPD_KILLEDTIME) / 60) % 60;
    new 
seconds ttt_get_playerdata(targetPD_KILLEDTIME) % 60;
    
ttt_get_kill_message(targetttt_get_playerdata(targetPD_KILLEDBY), killmsgcharsmax(killmsg), 0);

    const 
SIZE 1536;
    static 
msg[SIZE+1], motdname[64];
    new 
lenkilledstate ttt_get_alivestate(target);
    if(
killedstate 3)
        
killedstate 0;

    
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 url('gfx/ttt/%d.gif') no-repeat center top;}</style></head><body>"killedstate);
    
len += formatex(msg[len], SIZE len"</br><center><h1>%L %s</h1>"idspecial_names[killedstate], name[0]);
    
len += formatex(msg[len], SIZE len"<h1>%L</h1>"id"TTT_INFO_LINE3"g_szColors[killedstate], ttt_get_bodydata(targetBODY_TIME));
    
len += formatex(msg[len], SIZE len"%L <img src='gfx/ttt/%s.gif'></center>"id"TTT_INFO_LINE2"g_szColors[killedstate], minutessecondskillmsg);
    
len += formatex(msg[len], SIZE len"</body></html>");
    
formatex(motdnamecharsmax(motdname), "%L"id"TTT_INFO_LINE1");

    
show_motd(idmsgmotdname);

    
get_user_name(idname[1], charsmax(name[]));
    
ttt_log_to_file(LOG_MISC"%s inspected deadbody of %s"name[1], name[0]);
}

public 
show_last_states(id)
{
    const 
SIZE 1536;
    static 
msg[SIZE+1], show;

    if(!
g_iCached[1])
    {
        new 
len;
        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 no-repeat center top;}</style></head><body>");

        new 
numplayerplayer_statecount[PLAYER_CLASS];
        static 
players[32], name[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
player players[num];
            
player_state g_iPlayerStates[player][0];
            if(
player_state > -1)
            {
                
count[player_state]++;
                
get_user_name(playernamecharsmax(name));
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>[%L] %s</b></br>"g_szColors[player_state], idspecial_names[player_state], name);
            }
        }

        
len += formatex(msg[len], SIZE len"</br>");
        for(new 
0PLAYER_CLASSi++)
        {
            if(
count[i])
            {
                
show true;
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %d</b></br>"g_szColors[i], idspecial_names[i], count[i]);
            }
        }

        
len += formatex(msg[len], SIZE len"</body></html>");
        
g_iCached[1] = true;
    }

    if(
show)
        
show_motd(idmsg"");

[Imagen: FtQWJi4.jpg?1]
Responder
#5
Alguien me ayuda? Confundido pls
Responder
#6
Código PHP:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <cs_weapons_api>
#include <amx_settings_api>
#include <fun>
#include <ttt>

#define WEAPON_CSWID CSW_DEAGLE
#define WEAPON_NAME "weapon_deagle"

new g_iItemIDg_pMsgScreenFade;
new 
g_szModels[3][TTT_FILELENGHT];
new 
cvar_weapon_damagecvar_weapon_speedcvar_weapon_ammocvar_weapon_clipcvar_weapon_pricecvar_weapon_reloadcvar_weapon_recoil;
new 
g_iGlowing[33], g_iAlreadyShot[33];

public 
plugin_precache()
{
    if(!
amx_load_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_V"g_szModels[0], charsmax(g_szModels[])))
    {
        
g_szModels[0] = "models/ttt/v_golden.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_V"g_szModels[0]);
    }
    
precache_model(g_szModels[0]);

    if(!
amx_load_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_P"g_szModels[1], charsmax(g_szModels[])))
    {
        
g_szModels[1] = "models/ttt/p_golden.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_P"g_szModels[1]);
    }
    
precache_model(g_szModels[1]);

    if(!
amx_load_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_W"g_szModels[2], charsmax(g_szModels[])))
    {
        
g_szModels[2] = "models/ttt/w_golden.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"Golden Gun""MODEL_W"g_szModels[2]);
    }
    
precache_model(g_szModels[2]);
}

public 
plugin_init()
{
    
register_plugin("[TTT] Item: Golden Gun"TTT_VERSIONTTT_AUTHOR);

    
cvar_weapon_clip    my_register_cvar("ttt_golden_clip",    "1",    "Golden Gun clip ammo. (Default: 1)");
    
cvar_weapon_ammo    my_register_cvar("ttt_golden_ammo",    "0",    "Golden Gun backpack ammo. (Default: 0)");
    
cvar_weapon_speed    my_register_cvar("ttt_golden_speed",    "0.1",    "Golden Gun attack speed delay. (Default: 0.1)");
    
cvar_weapon_damage    my_register_cvar("ttt_golden_damage",    "0.0",    "Golden Gun damage multiplier. (Default: 0.0)");
    
cvar_weapon_reload    my_register_cvar("ttt_golden_reload",    "0.0",    "Golden Gun reload speed. (Default: 0.0)");
    
cvar_weapon_recoil    my_register_cvar("ttt_golden_recoil",    "0.0",    "Golden Gun recoil. (Default: 0.0)");
    
cvar_weapon_price    my_register_cvar("ttt_price_golden",    "2",    "Golden Gun price. (Default: 2)");

    
g_pMsgScreenFade    get_user_msgid("ScreenFade");
}

public 
ttt_plugin_cfg()
{
    new 
name[TTT_ITEMLENGHT];
    
formatex(namecharsmax(name), "%L"LANG_PLAYER"TTT_ITEM_ID14");
    
g_iItemID ttt_buymenu_add(nameget_pcvar_num(cvar_weapon_price), PC_DETECTIVE);
}

public 
ttt_gamemode(gamemode)
{
    if(
gamemode == GAME_PREPARING || gamemode == GAME_RESTARTING)
    {
        new 
numid;
        static 
players[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
id players[num];
            
g_iAlreadyShot[id] = false;
            if(
g_iGlowing[id])
            {
                
g_iGlowing[id] = false;
                
set_user_rendering(id);
            }
        }
    }
}

public 
ttt_item_selected(iditemname[], price)
{
    if(
g_iItemID == item)
    {
        if(
user_has_weapon(idWEAPON_CSWID))
            
engclient_cmd(id"drop"WEAPON_NAME);

        static 
data[STOREABLE_STRUCTURE];
        if(!
data[STRUCT_CSWA_CSW])
        {
            
data[STRUCT_CSWA_ITEMID] = g_iItemID;
            
data[STRUCT_CSWA_CSW] = WEAPON_CSWID;
            
data[STRUCT_CSWA_CLIP] = get_pcvar_num(cvar_weapon_clip);
            
data[STRUCT_CSWA_MAXCLIP] = get_pcvar_num(cvar_weapon_clip);
            
data[STRUCT_CSWA_AMMO] = get_pcvar_num(cvar_weapon_ammo);
            
data[STRUCT_CSWA_STACKABLE] = true;
            
data[STRUCT_CSWA_SILENCED] = -1;
            
data[STRUCT_CSWA_SPEEDDELAY] = _:get_pcvar_float(cvar_weapon_speed);
            
data[STRUCT_CSWA_DAMAGE] = _:get_pcvar_float(cvar_weapon_damage);
            
data[STRUCT_CSWA_RELOADTIME] = _:get_pcvar_float(cvar_weapon_reload);
            
data[STRUCT_CSWA_RECOIL] = _:get_pcvar_float(cvar_weapon_recoil);
            
data[STRUCT_CSWA_MODEL_V] = g_szModels[0];
            
data[STRUCT_CSWA_MODEL_P] = g_szModels[1];
            
data[STRUCT_CSWA_MODEL_W] = g_szModels[2];
        }
        
cswa_give_specific(iddata);

        
g_iAlreadyShot[id] = false;
        
client_print_color(idprint_team_default"%s %L"TTT_TAGid"TTT_ITEM2"nameid"TTT_ITEM5");
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
cswa_damage(weapon_idvictimattackerFloat:damage)
{
    if(!
g_iAlreadyShot[attacker] && get_weapon_edict(weapon_idREPL_CSWA_ITEMID) == g_iItemID)
    {
        static 
name[2][32];
        
get_user_name(attackername[0], charsmax(name[]));

        new 
player_state ttt_get_playerstate(victim);
        if(
player_state == PC_TRAITOR)
        {
            
g_iGlowingvictim ] = true;
            
set_user_healthvictimget_user_healthvictim ) - );
            
set_user_renderingvictimkRenderFxGlowShell25500kRenderNormal30 );
            
client_print_colorvictimprint_team_defaultget_user_healthvictim ) > "Se te ha marcado rojo" "Por Ser Traidor" );
        }
        else if(
player_state == PC_INNOCENT)
        {
            
g_iGlowing[victim] = true;
            
screen_fade(victim);
            
set_user_rendering(victimkRenderFxGlowShellg_iTeamColors[player_state][0], g_iTeamColors[player_state][1], g_iTeamColors[player_state][2], kRenderNormal30);
            
client_print_color(victimprint_team_default"%s %L"TTT_TAGvictim"TTT_ITEM_GOLDEN"victimspecial_names[PC_INNOCENT], victimspecial_names[ttt_get_playerstate(attacker)], name[0]);
        }

        
get_user_name(victimname[1], charsmax(name[]));
        
ttt_log_to_file(LOG_ITEM"%s used %L on [%L] %s"name[0], LANG_PLAYER"TTT_ITEM_ID14"LANG_PLAYERspecial_names[player_state], name[1]);
        
g_iAlreadyShot[attacker] = true;
    }
}

stock screen_fade(id)
{
    
message_begin(MSG_ONE_UNRELIABLEg_pMsgScreenFade_id);
    
write_short(FixedUnsigned16(1.01<<12));
    
write_short(0);
    
write_short((SF_FADE_MODULATE)); //flags (SF_FADE_IN + SF_FADE_ONLYONE) (SF_FADEOUT)
    
write_byte(g_iTeamColors[PC_INNOCENT][0]);
    
write_byte(g_iTeamColors[PC_INNOCENT][1]);
    
write_byte(g_iTeamColors[PC_INNOCENT][2]);
    
write_byte(180);
    
message_end();

[Imagen: FtQWJi4.jpg?1]
Responder
#7
Yo tengo el mismo problema con el ban por bajo karma. Seteo desde la cfg y/o desde el sma y no pasa nada. Inclusive GuskiS me quiso ayudar pero tampoco me toma eso, no sé qué será.
Se puede hacer un plugin aparte para esa accion?
Responder
#8
(05/05/2016, 06:05 PM)bitterness. escribió: Yo tengo el mismo problema con el ban por bajo karma. Seteo desde la cfg y/o desde el sma y no pasa nada. Inclusive GuskiS me quiso ayudar pero tampoco me toma eso, no sé qué será.
Se puede hacer un plugin aparte para esa accion?

Probaste cambiando la forma en la que aplica el baneo?

Así es como viene default

Código PHP:
stock ban_user_lowkarma(id)
{
    new 
karma ttt_get_playerdata(idPD_KARMATEMP);
    if(
karma <= get_pcvar_num(cvar_warnings_minkarma))
    {
        
server_cmd("amx_banip %d #%d MIN_KARMA:%d"get_pcvar_num(cvar_warnings_bantime), get_user_userid(id), karma);
        
g_iWarnings[id][WARN_BANNED] = true;
    }

Responder
#9
tendrias que diseñar un plugins solamente aparte para que pueda banear es la unica forma ya yo lo hice y me funciono diseñe un rkmetro aparte
[Imagen: FtQWJi4.jpg?1]
Responder
#10
(05/05/2016, 04:45 PM)JDAMPV escribió: revisa imbox te puedo ayudar

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <ttt>

new g_iCached[2], g_iKilledWho[33][33], g_pCommandMenuID1g_pCommandMenuID2g_iPlayerStates[33][2];
new const 
g_szIconNames[][] = 
{
    
"suicide""p228""""scout""hegrenade""xm1014""c4""mac10""aug""hegrenade""elite""fiveseven",
    
"ump45""sg550""galil""famas""usp""glock18""awp""mp5navy""m249""m3""m4a1""tmp""g3sg1""hegrenade",
    
"deagle""sg552""ak47""crowbar""p90""0""1""2""3"
};

new const 
g_szColors[][] = 
{
    
"#848284"// grey
    
"#fc0204"// red
    
"#0402fc"// blue
    
"#048204"// green
    
"#E211F5"// purple
    
"#F57011"  // orange
};

public 
plugin_precache()
{
    static 
icon[32];
    for(new 
0<= charsmax(g_szIconNames); i++)
    {
        if(
&& strlen(g_szIconNames[i]) < 3) continue;
        
formatex(iconcharsmax(icon), "gfx/ttt/%s.gif"g_szIconNames[i]);
        
precache_generic(icon);
    }
}

public 
plugin_init()
{
    
register_plugin("[TTT] Show infos"TTT_VERSIONTTT_AUTHOR);

    
// register_clcmd("say /tttme", "ttt_show_me");
    // register_clcmd("say_team /tttme", "ttt_show_me");
    
g_pCommandMenuID1 ttt_command_add("/me");
    
g_pCommandMenuID2 ttt_command_add("Last states");

    
RegisterHamPlayer(Ham_Killed"Ham_Killed_post"1);
}

public 
ttt_command_selected(idmenuidname[])
{
    if(
g_pCommandMenuID1 == menuid)
        
ttt_show_me(id);
    else if(
g_pCommandMenuID2 == menuid)
        
show_last_states(id);
}

public 
ttt_gamemode(gamemode)
{
    if(
gamemode == GAME_PREPARING || gamemode == GAME_RESTARTING || gamemode == GAME_STARTED)
    {
        new 
numid;
        static 
players[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
id players[num];
            
reset_player(id);
            if(
gamemode == GAME_STARTED)
                
swap_player_states(id);
        }

        if(
gamemode == GAME_STARTED)
            
g_iCached[1] = false;
    }
}

public 
client_putinserver(id)
{
    
g_iPlayerStates[id][0] = -1;
    
g_iPlayerStates[id][1] = -1;
    
reset_player(idid);
}

stock swap_player_states(id)
{
    
g_iPlayerStates[id][0] = g_iPlayerStates[id][1];
    
g_iPlayerStates[id][1] = ttt_get_playerstate(id);
}

stock reset_player(idother 0)
{
    new 
numplayer;
    static 
players[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
player players[num];
        
g_iKilledWho[id][player] = false;
        if(
other)
        {
            
g_iKilledWho[player][id] = false;
        }
    }
}

public 
ttt_winner(team)
{
    
g_iCached[0] = false;
    
g_iCached[1] = false;
    new 
numid;
    static 
players[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
id players[num];
        
client_cmd(id"-attack");
        
client_cmd(id"-attack2");
        
show_motd_winner(id);
    }
}

public 
ttt_showinfo(idtarget)
{
    new 
mode ttt_get_gamemode(); 
    if(!
is_user_alive(target) && is_user_alive(id) &&  mode != GAME_ENDED && mode != GAME_OFF)
    {
        new 
named[32], namev[32];
        
get_user_name(idnamedcharsmax(named));
        
get_user_name(targetnamevcharsmax(namev));
        
client_print_color(0print_team_default,"[!gTTT!n]: !t%s !nha inspeccionado a !g%s !n[!t%L!n]"namednamevidspecial_names[ttt_get_alivestate(target)]); // by thom1
        
show_motd_info(idtarget);
    }
}

public 
ttt_show_me(id)
{
    if(
ttt_get_gamemode() == GAME_OFF)
        return;

    if(!
is_user_alive(id))
    {
        const 
SIZE 1536;
        static 
msg[SIZE+1];
        new 
len;

        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 no-repeat center top;}</style></head><body>");
        
len += formatex(msg[len], SIZE len"</br><center><h2>%L</h2></center>"id"TTT_WINNER_LINE7");

        new 
numplayercountalive_state;
        static 
players[32], name[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
player players[num];
            if(
g_iKilledWho[id][player])
            {
                
count++;
                
alive_state ttt_get_alivestate(player);
                
get_user_name(playernamecharsmax(name));
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>[%L] %s</b></br>"g_szColors[alive_state], idspecial_names[alive_state], name);
            }
        }

        if(!
countlen += formatex(msg[len], SIZE len"%L"id"TTT_WINNER_LINE6");
        
len += formatex(msg[len], SIZE len"</body></html>");

        
show_motd(idmsg"");
    }
    else 
client_print_color(idprint_team_default"%s %L"TTT_TAGid"TTT_ALIVE");
}

public 
Ham_Killed_post(victimkillershouldgib)
{
    if(!
is_user_connected(killer))
        
killer ttt_find_valid_killer(victimkiller);

    if(!
is_user_connected(killer) || ttt_get_gamemode() == GAME_ENDED)
        return 
HAM_IGNORED;

    
g_iKilledWho[killer][victim] = ttt_get_alivestate(victim);
    return 
HAM_HANDLED;
}

public 
show_motd_winner(id)
{
    if(!
is_user_connected(id) || ttt_get_gamemode() == GAME_OFF)
        return;

    const 
SIZE 1536;
    static 
wholemsg[SIZE+1], msg[SIZE+1], motdname[64], staticsize;
    new 
zumlen;
    if(!
g_iCached[0])
    {
        new 
ihighestnumkilledstatecurrentstate;
        new 
name[32], Traitors[256], Detectives[256], suicide[128], kills[128], c4[70], out[64], players[32];

        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
players[num];

            
killedstate ttt_get_alivestate(i);
            
currentstate ttt_get_playerstate(i);
            
get_user_name(inamecharsmax(name));

            if(
currentstate == PC_TRAITOR || killedstate == PC_TRAITOR)
                
format(Traitorscharsmax(Traitors), "%s, %s"nameTraitors);

            if(
currentstate == PC_DETECTIVE || killedstate == PC_DETECTIVE)
                
format(Detectivescharsmax(Detectives), "%s, %s"nameDetectives);

            if(
ttt_get_playerdata(iPD_KILLEDBY) == 3005)
                
format(suicidecharsmax(suicide), "%s, %s"namesuicide);

            if(
ttt_get_playerdata(iPD_C4EXPLODED))
                
format(c4charsmax(c4), "%s, %s"namec4);

            if(
ttt_get_playerdata(iPD_KILLCOUNT) > highest)
            {
                if(
currentstate != PC_DEAD)
                    
zum currentstate;
                else 
zum killedstate;

                
highest ttt_get_playerdata(iPD_KILLCOUNT);
                
formatex(killscharsmax(kills), "%L"LANG_SERVER"TTT_WINNER_LINE4"g_szColors[zum], LANG_SERVERspecial_names[zum], namehighest);
            }
        }

        if(
strlen(Traitors) > 2)
            
Traitors[strlen(Traitors)-2] = '^0';

        if(
strlen(Detectives) > 2)
            
Detectives[strlen(Detectives)-2] = '^0';

        if(
strlen(suicide) > 2)
            
suicide[strlen(suicide)-2] = '^0';

        if(
strlen(c4) > 2)
            
c4[strlen(c4)-2] = '^0';

        new 
winner ttt_get_winner();
        if(
winner == PC_DETECTIVE)
            
winner++;

        if(
winner == PC_TRAITOR)
            
formatex(outcharsmax(out), "%L"LANG_SERVER"TTT_TWIN");
        else if(
winner == PC_INNOCENT)
            
formatex(outcharsmax(out), "%L"LANG_SERVER"TTT_IWIN");

        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 url('gfx/ttt/%d.gif') no-repeat center top;}</style></head><body>"winner);
        
len += formatex(msg[len], SIZE len"</br><center><h1>%s</h1></center>"out);

        if(
strlen(Detectives) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %s</b><br/>"g_szColors[PC_DETECTIVE], LANG_SERVERspecial_names[PC_DETECTIVE], Detectives);
        
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %s</b><br/><br/>"g_szColors[PC_TRAITOR], LANG_SERVERspecial_names[PC_TRAITOR], Traitors);

        if(
strlen(kills) > 0)
            
len += formatex(msg[len], SIZE len"%s<br/>"kills);

        if(
strlen(suicide) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L<br/>"g_szColors[PC_SPECIAL], LANG_SERVER"TTT_WINNER_LINE2"suicide);

        if(
strlen(c4) > 0)
            
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L<br/>"g_szColors[PC_SPECIAL], LANG_SERVER"TTT_WINNER_LINE3"c4);

        
formatex(motdnamecharsmax(motdname), "%L"LANG_SERVER"TTT_WINNER_LINE1");
        
g_iCached[0] = true;
        
staticsize len;
    }
    
len staticsize;
    
formatex(wholemsgcharsmax(msg), "%s"msg);

    
// len += formatex(wholemsg[len], SIZE - len, "%L</br>", LANG_SERVER, "TTT_WINNER_LINE7");
    
new numplayercountalive_state;
    static 
players[32], name[32];
    
get_players(playersnum);
    for(--
numnum >= 0num--)
    {
        
player players[num];
        if(
g_iKilledWho[id][player])
        {
            
count++;
            
alive_state ttt_get_alivestate(player);
            
get_user_name(playernamecharsmax(name));
            
len += formatex(wholemsg[len], SIZE len"%L <b style='color:%s'>[%L] %s</b></br>"LANG_SERVER"TTT_WINNER_LINE7"g_szColors[alive_state], LANG_SERVERspecial_names[alive_state], name);
        }
    }

    if(!
countformatex(wholemsg[len], SIZE len"%L"id"TTT_WINNER_LINE6");
    
    new 
karma ttt_get_playerdata(idPD_KARMA), karmatemp ttt_get_playerdata(idPD_KARMATEMP);
    
zum ttt_get_alivestate(id);
    
len += formatex(wholemsg[len], SIZE len"%L<br/>"LANG_SERVER"TTT_WINNER_LINE5"g_szColors[zum], karmag_szColors[zum], karmatemp-karmag_szColors[zum], karmatemp);
    
len += formatex(wholemsg[len], SIZE len"</body></html>");

    
show_motd(idwholemsgmotdname);
    
wholemsg[0] = '^0';
}

public 
show_motd_info(idtarget)
{
    static 
name[2][32], killmsg[64];
    
get_user_name(targetname[0], charsmax(name[]));
    new 
minutes = (ttt_get_playerdata(targetPD_KILLEDTIME) / 60) % 60;
    new 
seconds ttt_get_playerdata(targetPD_KILLEDTIME) % 60;
    
ttt_get_kill_message(targetttt_get_playerdata(targetPD_KILLEDBY), killmsgcharsmax(killmsg), 0);

    const 
SIZE 1536;
    static 
msg[SIZE+1], motdname[64];
    new 
lenkilledstate ttt_get_alivestate(target);
    if(
killedstate 3)
        
killedstate 0;

    
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 url('gfx/ttt/%d.gif') no-repeat center top;}</style></head><body>"killedstate);
    
len += formatex(msg[len], SIZE len"</br><center><h1>%L %s</h1>"idspecial_names[killedstate], name[0]);
    
len += formatex(msg[len], SIZE len"<h1>%L</h1>"id"TTT_INFO_LINE3"g_szColors[killedstate], ttt_get_bodydata(targetBODY_TIME));
    
len += formatex(msg[len], SIZE len"%L <img src='gfx/ttt/%s.gif'></center>"id"TTT_INFO_LINE2"g_szColors[killedstate], minutessecondskillmsg);
    
len += formatex(msg[len], SIZE len"</body></html>");
    
formatex(motdnamecharsmax(motdname), "%L"id"TTT_INFO_LINE1");

    
show_motd(idmsgmotdname);

    
get_user_name(idname[1], charsmax(name[]));
    
ttt_log_to_file(LOG_MISC"%s inspected deadbody of %s"name[1], name[0]);
}

public 
show_last_states(id)
{
    const 
SIZE 1536;
    static 
msg[SIZE+1], show;

    if(!
g_iCached[1])
    {
        new 
len;
        
len += formatex(msg[len], SIZE len"<html><head><meta charset='utf-8'><style>body{background:#ebf3f8 no-repeat center top;}</style></head><body>");

        new 
numplayerplayer_statecount[PLAYER_CLASS];
        static 
players[32], name[32];
        
get_players(playersnum);
        for(--
numnum >= 0num--)
        {
            
player players[num];
            
player_state g_iPlayerStates[player][0];
            if(
player_state > -1)
            {
                
count[player_state]++;
                
get_user_name(playernamecharsmax(name));
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>[%L] %s</b></br>"g_szColors[player_state], idspecial_names[player_state], name);
            }
        }

        
len += formatex(msg[len], SIZE len"</br>");
        for(new 
0PLAYER_CLASSi++)
        {
            if(
count[i])
            {
                
show true;
                
len += formatex(msg[len], SIZE len"<b style='color:%s'>%L: %d</b></br>"g_szColors[i], idspecial_names[i], count[i]);
            }
        }

        
len += formatex(msg[len], SIZE len"</body></html>");
        
g_iCached[1] = true;
    }

    if(
show)
        
show_motd(idmsg"");


Totalmente nulo con lo que pidió el usuario. Eso sólo imprimiría un mensaje Diciendo: Pepe analizó a Jorge y era Inocente Lo que el pidió es el glow + el mensaje. Que ni siquiera se edita en ese plugin. Si alguien lo necesita no dude en contactarme
Whatever
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)