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

Subplugin Submission [T] List of Modified + Requested Plugins


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-18-2016 , 03:35   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1091

Fixed again:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new g_bAbility[33], g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "2") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_USE) 
        {
            if(g_bAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "You already use this ability for this round. Just wait until next round!")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "You can't use this ability when frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "Speed boost enabled!")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    // Disable speed boost
    g_bAbility[ID_SPEED_BOOST] = false
    
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Speed boost is over!")

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    g_bAbility[victim] = false
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
    return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
zmd94 is offline
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-18-2016 , 12:34   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1092

Quote:
Originally Posted by zmd94 View Post
Fixed again:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new g_bAbility[33], g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "2") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_USE) 
        {
            if(g_bAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "You already use this ability for this round. Just wait until next round!")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "You can't use this ability when frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "Speed boost enabled!")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    // Disable speed boost
    g_bAbility[ID_SPEED_BOOST] = false
    
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Speed boost is over!")

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    g_bAbility[victim] = false
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
    return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
i dont hold the key, i just have parachute on E and when i use it i keep getting the message maybe some way to change it to another letter, and the plugin works, but i still have unlimited ammo after the ability finished, any way to make this stop after ability?

edit: okay the ability works perfect actually, the unlimited ammo stops too, but if i press e again i get message that i can only use ability once per round but i still get the unlimited ammo, so for example i am shooting with ability and after ability stops and i have to reload i just press e again and q and q switch weapon fast and dont need to reload i can keep shooting, so the plugin doesnt stop unlimited ammo with the ability
__________________

ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!

Last edited by New and Clueless; 01-18-2016 at 12:43.
New and Clueless is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-19-2016 , 18:05   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1093

Fixed again:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new bool:g_bAbility[33], bool:g_bTempAbility[33]
new g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "2") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_USE) 
        {
            if(g_bTempAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "You already use this ability for this round. Just wait until next round!")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "You can't use this ability when frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bTempAbility[id] = true
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "Speed boost enabled!")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Ability is over!")
    
    g_bAbility[id] = false

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    g_bTempAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        g_bTempAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
        return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}

Last edited by zmd94; 01-21-2016 at 04:15.
zmd94 is offline
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-20-2016 , 17:28   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1094

Quote:
Originally Posted by zmd94 View Post
Fixed again:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new g_bAbility[33], g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "2") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_USE) 
        {
            if(g_bAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "You already use this ability for this round. Just wait until next round!")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "You can't use this ability when frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "Speed boost enabled!")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Ability is over!")

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
    return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
the unlimited ammo and movement speed are staying now, for all round, any chance to change bind to like T or something
__________________

ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
New and Clueless is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-21-2016 , 04:16   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1095

Fixed again:

https://forums.alliedmods.net/showpo...postcount=1093
zmd94 is offline
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-22-2016 , 15:03   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1096

Quote:
Originally Posted by zmd94 View Post
Fixed again:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new bool:g_bAbility[33], bool:g_bTempAbility[33]
new g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "2") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_USE) 
        {
            if(g_bTempAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "You already use this ability for this round. Just wait until next round!")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "You can't use this ability when frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bTempAbility[id] = true
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "Speed boost enabled!")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Ability is over!")
    
    g_bAbility[id] = false

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    g_bTempAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        g_bTempAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
        return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
Code:
//// zp_zadmin_ability.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zadmin_ability.sma(131) : error 017: undefined symbol "id"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zadmin_ability.sma(131 -- 134) : warning 215: expression has no e
ffect
//
// 1 Error.
// Could not locate output file compiled\zp_zadmin_ability.amx (compile failed).

//
// Compilation Time: 0.14 sec
// ----------------------------------------
__________________

ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
New and Clueless is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-25-2016 , 09:28   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1097

Just change below:
Code:
public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Ability is over!")
    
    g_bAbility[id] = false

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}
-->
Code:
public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "Ability is over!")
    
    g_bAbility[ID_SPEED_BOOST] = false

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}
zmd94 is offline
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-29-2016 , 13:21   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1098

alright, it compiled and its working perfectly, thanks alot man! you should definitely put this up beside the original admin ability for anyone else who wants it, here is the one with the fix so it compiles:

is there any way to change letter that you active the ability on? because parachute is on E in my server, so people will end up wasting ability by accident, thanks

also when you are zombie and have infected bomb you can use ability and then get unlimited infected bombs for the duration

Spoiler
__________________

ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!

Last edited by New and Clueless; 01-29-2016 at 13:28.
New and Clueless is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-29-2016 , 18:11   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1099

You can find IN_USE code and change it into IN_RELOAD. Then, if the player what to use the ability, they have to press reload button.

Next, for the unlimited infection bomb, just change below:
Code:
public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}
-->
Code:
public current_weapon(id)
{
    if(!zp_get_user_zombie(id) && g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}
zmd94 is offline
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-30-2016 , 09:32   Re: [T] List of Modified + Requested Plugins
Reply With Quote #1100

Quote:
Originally Posted by zmd94 View Post
You can find IN_USE code and change it into IN_RELOAD. Then, if the player what to use the ability, they have to press reload button.

Next, for the unlimited infection bomb, just change below:
Code:
public current_weapon(id)
{
    if(g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}
-->
Code:
public current_weapon(id)
{
    if(!zp_get_user_zombie(id) && g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}
Code:
//// zp_zadmin_ability.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zadmin_ability.sma(61) : error 017: undefined symbol "zp_get_user
_zombie"
//
// 1 Error.
// Could not locate output file compiled\zp_zadmin_ability.amx (compile failed).

//
// Compilation Time: 0.16 sec
// ----------------------------------------
ok i only had to go to inlcudes and add this:
Code:
#include <zombieplague>
so here is the updated code if you want to put it beside original admin ability, the button is on R now
Code:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

//////////////////////////////////////////////////////////////////
//                        DEFINE FLAG                           //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////

new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration

const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
    10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new bool:g_bAbility[33], bool:g_bTempAbility[33]
new g_JumpCount[33]

public plugin_init()
{
    register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
    
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_event("CurWeapon", "current_weapon", "be", "1=1")
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
    RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_CmdStart, "fw_Start")
    
    cvar_multijump = register_cvar("aa_multijump_amount", "0") // Amount of multi-jump given
    cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
    cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
    cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
    cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}

public current_weapon(id)
{
    if(!zp_get_user_zombie(id) && g_bAbility[id])
    {
        new iWeapon = get_user_weapon(id) 
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item(id, "weapon_hegrenade")
            cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_flashbang" )
            cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
        }
        
        if(iWeapon == CSW_HEGRENADE)
        {
            give_item( id, "weapon_smokegrenade" )
            cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
        }    
    }
}

public fw_Start(id) 
{
    if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG) 
    {
        if( pev(id, pev_button) & IN_RELOAD) 
        {
            if(g_bTempAbility[id])
            {
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "")
            }
            else
            {
                // Player frozen (or CS freezetime)
                if (pev(id, pev_maxspeed) <= 1)
                {
                    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                    show_hudmessage(id, "Relax, you're frozen!")
                    return PLUGIN_HANDLED;
                }
                
                g_bTempAbility[id] = true
                g_bAbility[id] = true
                
                set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
                set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
                
                set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
                show_hudmessage(id, "AAAAAAAWWWWWWWWWW YEEEEEEAAAAAHHHHH FEEL IT RUSHING THROUGH MY VAINS.....")
                
                // Set the restore speed task
                set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
                
                // Update player's maxspeed
                ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public restore_maxspeed(taskid)
{
    set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
    show_hudmessage(ID_SPEED_BOOST, "")
    
    g_bAbility[ID_SPEED_BOOST] = false

    // Update player's maxspeed
    ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}

public fw_PlayerKilled(victim)
{
    remove_task(victim + TASK_SPEED_BOOST)
}

public client_disconnect(id)
{
    g_bAbility[id] = false
    g_bTempAbility[id] = false
    remove_task(id + TASK_SPEED_BOOST)
}

public round_start()
{
    new iPlayers[32], iPlayerCount, i, id
    
    get_players(iPlayers, iPlayerCount, "a") 
    for(i = 0; i < iPlayerCount; i++)
    {
        id = iPlayers[i]
        
        g_bAbility[id] = false
        g_bTempAbility[id] = false
        remove_task(id + TASK_SPEED_BOOST)
    }
}

public fw_ResetMaxSpeed_Post(id)
{
    if (!is_user_alive(id) || !g_bAbility[id])
        return;
    
    // Apply speed boost
    new Float:current_maxspeed
    pev(id, pev_maxspeed, current_maxspeed)
    set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}

public fw_PlayerJump( id ) 
{    
    if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])    
    {    
        new Flags = pev( id, pev_flags )
        
        if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
        {
            return HAM_IGNORED
        }
        
        if( Flags & FL_ONGROUND ) 
        {
            g_JumpCount[ id ] = 0
            return HAM_IGNORED
        }
        new Multi = get_pcvar_num(cvar_multijump)
        if( Multi ) 
        {
            if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi ) 
            {
                new Float:fVelocity[ 3 ]
                pev( id, pev_velocity, fVelocity )
                fVelocity[ 2 ] = 268.328157
                set_pev( id, pev_velocity, fVelocity )

                return HAM_HANDLED
            }
        }
    }
    return HAM_IGNORED
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player doesn't have the unlimited clip upgrade
    if (!g_bAbility[msg_entity])
    return;
    
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
    return;
    
    static weapon, clip
    weapon = get_msg_arg_int(2) // get weapon ID
    clip = get_msg_arg_int(3) // get weapon clip
    
    // Unlimited Clip Ammo
    if (MAXCLIP[weapon] > 1) // skip grenades
    {
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
        
        if (clip < 2) // refill when clip is nearly empty
        {
            // Get the weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
            
            // Set max clip on weapon
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((entity = engfunc(EngFunc_FindEntityByString, entity,   "classname", classname)) && pev(entity, pev_owner) != owner) {}
    
    return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
__________________

ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!

Last edited by New and Clueless; 01-30-2016 at 10:33.
New and Clueless 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 04:41.


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