Raised This Month: $51 Target: $400
 12% 

heating plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 12-15-2020 , 21:33   heating plugin
Reply With Quote #1

I am testing this plugin, it is a warm-up I like, the theme that gives a random weapon and gives it with few bullets. I would like to know how to add more bullets and when she gives me the knife, my hand is empty. any solution?

PHP Code:
#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]);
    }    

El Abuelo Loco is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode