Calentamiento
#1
Estoy probando este plugin. alguien me puede dar una mano, tiene algunos errores. 

no me aparece el cuchillo, al darme un arma aleatoria me la da con 9 de balas. 

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

#define WARMUPTIME     40    // Ð’ремя Ð²Ð°Ñ€Ð¼Ð°Ð¿Ð°
#define NUM_RR        1    // ÐšÐ¾Ð»-во Ñ€ÐµÑÑ‚артов
#define LATENCY        1.5    // Ð—адержка Ð¼ÐµÐ¶Ð´Ñƒ Ñ€ÐµÑÑ‚артами
#define DHUD_MESSAGE        // ÐŸÐ¾ÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ Ð² dhud. Ð—акомментируйте, Ñ‡Ñ‚обы Ð±Ñ‹Ð» hud
#define GIVE_SHIELD    3    // 0 - Ð²Ñ‹ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒ; 1 - Ð©Ð¸Ñ‚ + deagle; 2 - Ñ‰Ð¸Ñ‚ + Ð½Ð¾Ð¶; 3 - Ñ‰Ð¸Ñ‚ Ð¸ Ñ Ð´Ð¸Ð³Ð»Ð¾Ð¼ Ð¸ Ð½Ð¾Ð¶Ð¾Ð¼
#define STOP_PLUGS        // ÐžÑ‚ключать Ð¿Ð»Ð°Ð³Ð¸Ð½Ñ‹ Ð½Ð° Ð²Ñ€ÐµÐ¼Ñ Ð²Ð°Ñ€Ð¼Ð°Ð¿Ð°
#define DM_MODE            // Ð‘есконечный Ñ€ÐµÑÐ¿Ð°Ð²Ð½ Ð½Ð° Ð²Ñ€ÐµÐ¼Ñ Ð²Ð°Ñ€Ð¼Ð°Ð¿Ð°
#define ThFiveHP_ON_KNIFE    // Ð’ыдает 35HP Ð¸Ð³Ñ€Ð¾ÐºÐ°Ð¼, ÐµÑÐ»Ð¸ Ð¾Ñ€ÑƒÐ¶Ð¸Ðµ - ÐÐžÐ–

#if defined STOP_PLUGS
    new g_arPlugins[][] =    // Ð£ÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ Ñ„айлов, Ð½Ð°Ð¿Ñ€Ð¸Ð¼ÐµÑ€ test.amxx
    {
        "test.amxx",
        "test2.amxx"
    }
#endif

new g_szWeapon[32];
new 
g_iWp;

new 
HamHook:fwd_HamSpawnHandle;
#if defined DM_MODE
new HamHook:fwd_HamKilledHandle;
#endif
new fwd_MessageHandleg_msgStatusIcon;
#if defined DHUD_MESSAGE
    #if AMXX_VERSION_NUM < 183
        #include <dhudmessage>
    #endif
#else
    new g_iHudSync;
#endif

public plugin_init()
{
    register_plugin("Random Weapons WarmUP""1.6""neugomon");
#if defined DM_MODE
    register_clcmd("joinclass",     "clCmdJoinClass");
    register_clcmd("menuselect",     "clCmdJoinClass");
#endif    
    register_event("TextMsg""eventGameCommencing""a""2=#Game_Commencing");
    register_event("HLTV",       "eventRoundStart",     "a""1=0""2=0");
    
    DisableHamForward
((fwd_HamSpawnHandle RegisterHam(Ham_Spawn"player""fwdPlayerSpawnPost"true)));
#if defined DM_MODE    
    DisableHamForward((fwd_HamKilledHandle RegisterHam(Ham_Killed"player""fwdPlayerKilledPost"true)));
#endif    
    g_msgStatusIcon get_user_msgid("StatusIcon");
#if !defined DHUD_MESSAGE
    g_iHudSync    CreateHudSyncObj();
#endif    
    state WarmUPBlocked;
}

public 
eventGameCommencing()
    state WarmUPStarted;

public 
eventRoundStart() <WarmUPBlocked>    
    
return;
public 
eventRoundStart() <WarmUPStarted>    
{
    if(task_exists(67554564))
        return;
    
    fwd_MessageHandle 
register_message(g_msgStatusIcon"msgStatusIcon");
        
    EnableHamForward
(fwd_HamSpawnHandle);
#if defined DM_MODE    
    EnableHamForward(fwd_HamKilledHandle);
#endif    
#if defined STOP_PLUGS    
    PluginController(1);
#endif    
    switch((g_iWp random(4)))
    {
        case 0formatex(g_szWeaponcharsmax(g_szWeapon), "AWP");
        case 1formatex(g_szWeaponcharsmax(g_szWeapon), "Deagle");
        case 2formatex(g_szWeaponcharsmax(g_szWeapon), "Scout");
        case 3formatex(g_szWeaponcharsmax(g_szWeapon), "Knife");
    }
        
    set_task
(1.0"ShowTimer"67554564, .flags "a", .repeat WARMUPTIME);
}
#if defined DM_MODE
public clCmdJoinClass(id) <WarmUPBlocked>
    return;
public 
clCmdJoinClass(id) <WarmUPStarted>
    if(get_pdata_int(id205) == 3)
        set_task(1.0"SpawnPlayer"id);
#endif
public fwdPlayerSpawnPost(const id)
{
    if(!is_user_alive(id))
        return;
        
    
if(fm_strip_user_weapons(id))
    {
        switch(g_iWp)
        {
            case 0:
            {
                fm_give_item(id"weapon_awp");
                cs_set_user_bpammo(idCSW_AWP50);
            }
            case 1:
            {
            #if GIVE_SHIELD == 1 || GIVE_SHIELD == 3
                fm_give_item(id"weapon_shield");
            #endif
                fm_give_item(id"weapon_deagle");
                cs_set_user_bpammo(idCSW_DEAGLE50);
            }
            case 2:
            {
                fm_give_item(id"weapon_scout");
                cs_set_user_bpammo(idCSW_SCOUT50);
            }
            case 4:
            {
            #if GIVE_SHIELD == 2 || GIVE_SHIELD == 3
                fm_give_item(id"weapon_shield");
            #endif
                fm_give_item(id"weapon_knife");
            #if defined ThFiveHP_ON_KNIFE
                fm_set_user_health(id35);
            #endif    
            }    
        
}
    }    
}
#if defined DM_MODE
public fwdPlayerKilledPost(pVictim)
    set_task(1.0"SpawnPlayer"pVictim);
#endif
public msgStatusIcon(msgIdmsgDestmsgEnt)
{
    if(!get_msg_arg_int(1))
        return PLUGIN_CONTINUE;
    
    
static szIcon[8];
    get_msg_arg_string(2szIconcharsmax(szIcon));
 
    if(!strcmp(szIcon"buyzone"))
    {
        set_pdata_int(msgEnt235get_pdata_int(msgEnt235) & ~(1<<0));
        return PLUGIN_HANDLED;
    }
    return PLUGIN_CONTINUE
}
    
    
public ShowTimer()
{
    static timer = -1
    if(timer == -1timer WARMUPTIME;
    
    
switch(--timer)
    {
        case 0
        {
            state WarmUPBlocked;
            DisableHamForward(fwd_HamSpawnHandle);
        #if defined DM_MODE    
            DisableHamForward(fwd_HamKilledHandle);
        #endif    
            unregister_message(g_msgStatusIconfwd_MessageHandle);
        #if defined STOP_PLUGS    
            PluginController(0);
        #endif    
        #if NUM_RR > 1        
            set_task(LATENCY"SV_Restart", .flags "a", .repeat NUM_RR);
        #else
            SV_Restart();
        #endif
            timer = -1;
        }
        default:
        {
        #if defined DHUD_MESSAGE
            set_dhudmessage(.red 135, .green 206, .blue 235, .= -1.0, .0.08, .holdtime 0.9);
            show_dhudmessage(0"El Calentamiento empezo con el arma %s!^nTermina en %d segundos."g_szWeapontimer);
        #else    
            set_hudmessage(135206235, .= -1.0, .0.9, .holdtime 1.03, .channel = -1);
            ShowSyncHudMsg(0g_iHudSync"El Calentamiento empezo con el arma %s!^nTermina en %d segundos."g_szWeapontimer);
        #endif    
        }
    }
}

public 
SV_Restart()
    set_cvar_num("sv_restart"1);
#if defined DM_MODE    
public SpawnPlayer(id)
{
    if(is_user_alive(id))
        return;
        
    
switch(get_pdata_int(id114))
    {
        case 12ExecuteHamB(Ham_CS_RoundRespawnid);
    }
}
#endif
stock PluginController(stop)
{
    for(new isizeof g_arPluginsi++)
    {
        if(stop)pause  ("ac"g_arPlugins[i]);
        else    unpause("ac"g_arPlugins[i]);
    }    


Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)