Problemas con este plugin
#1
buenas ya hace tiempo que estuve retirado de esto y me decidí en editar un modo que encontré en el foro mis problemas son que al iniciar un servidor dedicado y dejarlo prendido por x minutos luego ingresar al servidor , escoger equipo pero esperar unos segundos a que me reviva lo cual no lo hace este modo ese es mi gran problema aparte quiero pedir si me pueden agregar otro método para bloquear el buy ya que esto lo encuentro que ocupa muchas lineas.


bueno eso es lo que quería pedir sin mas que decir dejo el code abajo.

Código PHP:
/*===============================================================================​​=
 [INICIO DEL MOD]
================================================================================​​=*/
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fun>
#include <fakemeta>

#define PLUGIN "Deathmatch"
#define VERSION "1.0"
#define AUTHOR "Skylar"

const OFFSET_JOINSTATE 121;
const 
OFFSET_CSMENUCODE 205;

// Cvars
new dm_revivedm_proteccion

new HamHook:g_iHhCBasePlayerPreThink;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* = Hams = */
    
RegisterHam(Ham_Killed"player""Ham_PlayerKilled"1)
    
DisableHamForward(g_iHhCBasePlayerPreThink RegisterHam(Ham_Player_PreThink"player""OnHam__PlayerPreThink_Post"1));
    
    
/* = Comandos */
    
register_clcmd("menuselect""ClientCommand__MenuSelect");
    
register_clcmd("joinclass""ClientCommand__MenuSelect");
    
register_clcmd("client_buy_open""BloquearBuyMenu")
    
register_clcmd("buy""BloquearComandos")
    
register_clcmd("buyammo1""BloquearComandos")
    
register_clcmd("buyammo2""BloquearComandos")
    
register_clcmd("buyequip""BloquearComandos")
    
register_clcmd("cl_autobuy""BloquearComandos")
    
register_clcmd("cl_rebuy""BloquearComandos")
    
register_clcmd("cl_setautobuy""BloquearComandos")
    
register_clcmd("cl_setrebuy""BloquearComandos")
    
register_clcmd("drop""BloquearComandos")
    
    
/* = Cvars = */
    
dm_revive register_cvar("deathmatch_respawn""3.0")
    
dm_proteccion register_cvar("deathmatch_proteccion""5.0")
    
    
remove_entity_name("func_bomb_target"
    
remove_entity_name("info_bomb_target"
}

/*===============================================================================​​=
 [HAMS]
================================================================================​​=*/
public Ham_PlayerKilled(victimattackershouldgib)
{
    if(
victim == attacker || !is_user_connected(attacker))
    return
        
    
set_task(get_pcvar_float(dm_revive), "RevivirJugador"victim)

    
set_hudmessage(25500, -1.0, -1.016.03.0)
    
show_hudmessage(victim"[DM] Reviviras en %d segundos"get_pcvar_num(dm_revive));
}

public 
OnHam__PlayerPreThink_Post(const id) {
    
DisableHamForward(g_iHhCBasePlayerPreThink);

    if(!
is_user_alive(id)) {
        
RevivirJugador(id);
    }
}
/*===============================================================================​​=
 [OTROS]
================================================================================​​=*/
public RevivirJugador(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
set_hudmessage(2552550, -1.0, -1.016.04.0)
    
show_hudmessage(id"[DM] Acabas de revivir.");
    
    
set_user_godmode(id1)
    
Print_Color(id"!g[DM] !yObtienes proteccion por !g%d !ysegundos."get_pcvar_num(dm_proteccion))
    
    switch(
cs_get_user_team(id)) {
        case 
CS_TEAM_Tset_rendering(idkRenderFxGlowShell25500kRenderNormal50)
        case 
CS_TEAM_CTset_rendering(idkRenderFxGlowShell00255kRenderNormal50)
    }

    
set_task(get_pcvar_float(dm_proteccion), "RemoverProteccion"id)
}

public 
RemoverProteccion(id)
{
    
set_user_godmode(id0)
    
set_rendering(id)
    
Print_Color(id"!g[DM] !ySe te acabaron los !g%d !ysegundos de proteccion."get_pcvar_num(dm_proteccion))
}

public 
ClientCommand__MenuSelect(const id) {
    if(
get_pdata_int(idOFFSET_CSMENUCODE) == && get_pdata_int(idOFFSET_JOINSTATE) == 4) {
        
EnableHamForward(g_iHhCBasePlayerPreThink);
    }
}

public 
BloquearComandos(id) return PLUGIN_HANDLED

public BloquearBuyMenu(id)
{
    static 
MsgBuyID
    MsgBuyID 
get_user_msgid("BuyClose")
    
message_begin(MSG_ONEMsgBuyID_id)
    
message_end()

    return 
PLUGIN_HANDLED
}
/*===============================================================================​​=
 [STOCK'S]
================================================================================​​=*/
stock Print_Color(id, const input[], any:...)
{
    static 
szMsg[191], msgSayText;
    
    if(!
msgSayText)
    
msgSayText get_user_msgid("SayText");
    
    
vformat(szMsg190input3);

    
replace_all(szMsg190"!g""^4");
    
replace_all(szMsg190"!y""^1");
    
replace_all(szMsg190"!team""^3");
    
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    
write_byte(id id 33);
    
write_string(szMsg);
    
message_end();

Responder
#2
https://amxmodx-es.com/Thread-CS-1-6-res...14#pid9714

Responder
#3
(03/05/2018, 05:42 PM)Skylar escribió: https://amxmodx-es.com/Thread-CS-1-6-res...14#pid9714

Entonces borrando

Código PHP:
register_clcmd("client_buy_open""BloquearBuyMenu")
    
register_clcmd("buy""BloquearComandos")
    
register_clcmd("buyammo1""BloquearComandos")
    
register_clcmd("buyammo2""BloquearComandos")
    
register_clcmd("buyequip""BloquearComandos")
    
register_clcmd("cl_autobuy""BloquearComandos")
    
register_clcmd("cl_rebuy""BloquearComandos")
    
register_clcmd("cl_setautobuy""BloquearComandos")
    
register_clcmd("cl_setrebuy""BloquearComandos")
    
register_clcmd("drop""BloquearComandos"

y agregando esto

Código PHP:
register_message(get_user_msgid("StatusIcon"), "message_statusicon")

// y luego
public message_statusicon(msg_idmsg_destid)
{
    static 
szIcon[8]
    
get_msg_arg_string(2szIconcharsmax(szIcon))
 
    if (
equal(szIcon"buyzone") && get_msg_arg_int(1))
    {
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
 
    return 
PLUGIN_CONTINUE;


ya bloqueo el buy ? tan fácil ?

ahora tengo otro problema el es que no te revive al momento de entrar a un equipo nose cual sera el problema.
Responder
#4
(04/05/2018, 02:08 PM)Jaimit0 escribió:
(03/05/2018, 05:42 PM)Skylar escribió: https://amxmodx-es.com/Thread-CS-1-6-res...14#pid9714

Entonces borrando

Código PHP:
register_clcmd("client_buy_open""BloquearBuyMenu")
    
register_clcmd("buy""BloquearComandos")
    
register_clcmd("buyammo1""BloquearComandos")
    
register_clcmd("buyammo2""BloquearComandos")
    
register_clcmd("buyequip""BloquearComandos")
    
register_clcmd("cl_autobuy""BloquearComandos")
    
register_clcmd("cl_rebuy""BloquearComandos")
    
register_clcmd("cl_setautobuy""BloquearComandos")
    
register_clcmd("cl_setrebuy""BloquearComandos")
    
register_clcmd("drop""BloquearComandos"

y agregando esto

Código PHP:
register_message(get_user_msgid("StatusIcon"), "message_statusicon")

// y luego
public message_statusicon(msg_idmsg_destid)
{
    static 
szIcon[8]
    
get_msg_arg_string(2szIconcharsmax(szIcon))
 
    if (
equal(szIcon"buyzone") && get_msg_arg_int(1))
    {
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0))
        return 
PLUGIN_HANDLED;
    }
 
    return 
PLUGIN_CONTINUE;


ya bloqueo el buy ? tan fácil ?

ahora tengo otro problema el es que no te revive al momento de entrar a un equipo nose cual sera el problema.

Hookeas joinclass y envias un task de 1.0 segundos con la funcion de revivir.

Código PHP:
register_clcmd"joinclass""fw_JoinClass" );

public 
fw_JoinClassID_USER ) { 

        if( !
is_user_aliveID_USER ) )
                return;

        
set_task1.0"fw_Function_Spawn"ID_USER );


Saludos. Crab
Responder
#5
(04/05/2018, 06:08 PM)Chema escribió: Hookeas joinclass y envias un task de 1.0 segundos con la funcion de revivir.

Código PHP:
register_clcmd"joinclass""fw_JoinClass" );

public 
fw_JoinClassID_USER ) { 

        if( !
is_user_aliveID_USER ) )
                return;

        
set_task1.0"fw_Function_Spawn"ID_USER );


Saludos. Crab


Genial agradecido
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)