AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to delete vip 2x dmg (https://forums.alliedmods.net/showthread.php?t=313456)

Mikaeel123 01-10-2019 08:08

How to delete vip 2x dmg
 
i want delete vip 2x damage in this plugin but when delete plugin not worked
PHP Code:

/* Plugin generated by AMXX-Studio
Special thanks:
HoBaK - For idea of the plugin.
<VeCo> - for help on the code.
Huku# - Test of plugin.
Taurus# - Test of plugin.
SCREAM. - Test of plugin.
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <colorchat>
#include <engine>
#include <hamsandwich>

#define VERSION "1.0"
#define TAG "[VIP Shop]"
new g_const_colors[][3] =
{
    {
255,0,0},
    {
0,255,0},
    {
0,0,255},
    {
255,255,0},
    {
255,0,255},
    {
0,255,255},
    {
0,128,255},
    {
255,255,255},
    {
255,128,0},
    {
128,0,255}
}

new 
    
vip_deagle_cost
    
vip_he_cost
    
vip_flash_cost
    
vip_smoke_cost
    
vip_flash_ammo
    
vip_he_ammo
    
vip_smoke_ammo,
    
g_start_vipjbp,
    
vip_jbpacks_kill,
    
vip_jbpacks_kill_hs,
    
vip_norm_kill_armor,
    
vip_norm_kill_hp,
    
vip_hs_kill_armor,
    
vip_hs_kill_hp,
    
vip_bullet_dmg,
    
syncObj,
    
vip_dmg_power,
    
glow_time,
    
g_jbpacks[33],
    
current_color[33]

public 
plugin_init() {
    
register_plugin("[JB] VIP Shop"VERSION"HoBaK")
    
register_clcmd("say /vshop""vip_shop_menu"ADMIN_LEVEL_H"VIP Shop For JailBreak")
    
register_clcmd("say_team /vshop""vip_shop_menu"ADMIN_LEVEL_H"VIP Shop For JailBreak")
    
register_clcmd("say /vipshop""vip_shop_menu"ADMIN_LEVEL_H"VIP Shop For JailBreak")
    
register_clcmd("say_team /vipshop""vip_shop_menu"ADMIN_LEVEL_H"VIP Shop For JailBreak")
    
    
register_event("DeathMsg""event_death""a")
    
register_event("Damage","event_damage","b","2!0")
    
RegisterHam(Ham_TakeDamage,"player","player_take_damage")
    
/* Cvars */
    
vip_deagle_cost register_cvar("jbe_vip_deagle_cost""10")
    
vip_he_cost register_cvar("jbe_vip_he_cost""4")
    
vip_flash_cost register_cvar("jbe_vip_flash_cost""6")
    
vip_smoke_cost register_cvar("jbe_vip_smoke_cost""2")
    
vip_flash_ammo register_cvar("jbe_vip_flash_ammo""4")
    
vip_he_ammo register_cvar("jbe_vip_he_ammo""2")
    
vip_smoke_ammo register_cvar("jbe_vip_smoke_ammo""1")
    
g_start_vipjbp register_cvar("jbe_vip_start_jbpacks""7")
    
vip_jbpacks_kill register_cvar("jbe_vip_kill_packs""5")
    
vip_jbpacks_kill_hs register_cvar("jbe_vip_kill_hs_packs""10")
    
vip_norm_kill_hp register_cvar("jbe_norm_kill_hp""5")
    
vip_norm_kill_armor register_cvar("jbe_norm_kill_armor""5")
    
vip_hs_kill_hp register_cvar("jbe_hs_kill_hp""10")
    
vip_hs_kill_armor register_cvar("jbe_hs_kill_armor""10")
    
vip_bullet_dmg register_cvar("jbe_vip_bullet_dmg""1")
    
vip_dmg_power register_cvar("jbe_vip_dmg_power""2.0")
    
glow_time register_cvar("jbe_vip_glow_time""5.0")
    
    
set_task(1.0,"JailbreakVIPPacks", .flags  "b")
    
syncObj CreateHudSyncObj()
    
    
set_task(get_pcvar_float(glow_time),"glow_change", .flags "b")
}

/* Give Health + Armor for headshot and for normal kill*/
public event_death()
{
    static 
killer,headshot_check
    killer 
read_data(1)
    
headshot_check read_data(3)
    
    if(
is_user_connected(killer) && (get_user_flags(killer) & ADMIN_LEVEL_H))
    {
        if(
headshot_check)
        {
            
g_jbpacks[killer] += get_pcvar_num(vip_jbpacks_kill_hs)
            
set_user_health(killer,get_user_health(killer) + get_pcvar_num(vip_hs_kill_hp))
            
set_user_armor(killer,get_user_armor(killer) + get_pcvar_num(vip_hs_kill_armor))
            
ColorChat(killerGREEN"%s ^x01You get Health:%i and Armor:%i for kill in head"TAGget_pcvar_num(vip_hs_kill_hp), get_pcvar_num(vip_hs_kill_armor))
        } 
        else 
        {
            
g_jbpacks[killer] += get_pcvar_num(vip_jbpacks_kill)
            
set_user_health(killer,get_user_health(killer) + get_pcvar_num(vip_norm_kill_hp))
            
set_user_armor(killer,get_user_armor(killer) + get_pcvar_num(vip_norm_kill_armor))
            
ColorChat(killerGREEN"%s ^x01You get Health:%i and Armor:%i for normal kill"TAGget_pcvar_num(vip_norm_kill_hp), get_pcvar_num(vip_norm_kill_armor))
        }
    }
}

/* VIP No Fall DMG + 2x DMG on CT */
public player_take_damage(victim,inflictor,attackerFloat:damagedamage_bits)
{    
    if(
is_user_connected(attacker) && get_user_flags(attacker) && ADMIN_LEVEL_H && cs_get_user_team(attacker) == CS_TEAM_CT)
    {
            
SetHamParamFloat(4,damage get_pcvar_num(vip_dmg_power))
    }
}

/* VIP Bullet Damage */
public event_damage(vip

    if(
get_pcvar_num(vip_bullet_dmg) > 0)
    {
        new 
attacker =get_user_attacker(vip)
        new 
damage read_data(2)
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H
        {
        
set_hudmessage(0100200, -1.00.7320.14.00.020.027)
        
show_hudmessage(attacker,"You deal:%i damage"damage)
        }
    }
}

/* VIP Shop Menu */
public vip_shop_menu(idlevelcid)
{
    new 
menu
    
if(!cmd_access(idlevelcid,1)) 
    {
        
ColorChat(idGREEN"%s ^x01 You don't have access to that command."TAG)
    }
    else
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        
menu menu_create("JB: VIP Shop Menu","vip_shop_menu_handler")
        new 
menu_str[128]
        
        
formatex(menu_str,charsmax(menu_str),"Deagle ---> Cost:%i",get_pcvar_num(vip_deagle_cost))
        
menu_additem(menu,menu_str,"1")
        
formatex(menu_str,charsmax(menu_str),"He Grenade Ammo:%i ---> Cost:%i",get_pcvar_num(vip_he_ammo),get_pcvar_num(vip_he_cost))
        
menu_additem(menu,menu_str,"2")
        
formatex(menu_str,charsmax(menu_str),"FlashBangs Ammo:%i ---> Cost:%i",get_pcvar_num(vip_flash_ammo),get_pcvar_num(vip_flash_cost))
        
menu_additem(menu,menu_str,"3")
        
formatex(menu_str,charsmax(menu_str),"Smoke Nades Ammo:%i ---> Cost:%i",get_pcvar_num(vip_smoke_ammo),get_pcvar_num(vip_smoke_cost))
        
menu_additem(menu,menu_str,"4")
        
        
menu_display(id,menu)
    }
}

public 
vip_shop_menu_handler(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
access,callbackinfo[4],name[32], get_info
    menu_item_getinfo
(menu,itemaccessinfo,charsmax(info), name,charsmax(name), callback)

    
get_info str_to_num(info)
    
    switch(
get_info)
    {
        case 
1:
        {
            if (
g_jbpacks[id]>= get_pcvar_num(vip_deagle_cost))
            {
                
g_jbpacks[id] -= get_pcvar_num(vip_deagle_cost)
                
give_item(id"weapon_deagle")
                
ColorChat(idGREEN"%s ^x01You get Deagle, ^x03[Good Luck]!"TAG)
            }
            else
            {
                
ColorChat(idGREEN"%s ^x01You don't have JBPacks to buy Deagle, ^x03[Good Luck]!"TAG)
            }
        }
        case 
2:
        {
            if (
g_jbpacks[id]>= get_pcvar_num(vip_he_cost))
            {
                
g_jbpacks[id] -= get_pcvar_num(vip_he_cost)
                
give_item(id"weapon_hegrenade") && cs_set_user_bpammo(idCSW_HEGRENADEget_pcvar_num(vip_he_ammo))
                
ColorChat(idGREEN"%s ^x01You get %i He Grande, ^x03[Good Luck]!"TAGget_pcvar_num(vip_he_ammo))
            }
            else
            {
                
ColorChat(idGREEN"%s ^x01You don't have JBPacks to buy He Granade, ^x03[Good Luck]!"TAG)
            }
        }
        case 
3:
        {
            if (
g_jbpacks[id]>= get_pcvar_num(vip_flash_cost))
            {
                
g_jbpacks[id] -= get_pcvar_num(vip_flash_cost)
                
give_item(id"weapon_flashbang") && cs_set_user_bpammo(idCSW_FLASHBANGget_pcvar_num(vip_flash_ammo))
                
ColorChat(idGREEN"%s ^x01You get %i FlashBangs, ^x03[Good Luck]!"TAGget_pcvar_num(vip_flash_ammo))
            }
            else
            {
                
ColorChat(idGREEN"%s ^x01You don't have JBPacks to buy FlashBang, ^x03[Good Luck]!"TAG)
            }
        }
        case 
4:
        {
            if (
g_jbpacks[id]>= get_pcvar_num(vip_smoke_cost))
            {
                
g_jbpacks[id] -= get_pcvar_num(vip_smoke_cost)
                
give_item(id"weapon_smokegrenade") && cs_set_user_bpammo(idCSW_SMOKEGRENADEget_pcvar_num(vip_smoke_ammo))
                
ColorChat(idGREEN"%s ^x01You get %i SmokeGrenade, ^x03[Good Luck]!"TAGget_pcvar_num(vip_smoke_ammo))
            }
            else
            {
                
ColorChat(idGREEN"%s ^x01You don't have JBPacks to buy Smoke Granade, ^x03[Good Luck]!"TAG)
            }
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

/* Activate the Hud message VIP JB Packs on VIP Player*/
public client_putinserver(id)
{
    
g_jbpacks[id] = get_pcvar_num(g_start_vipjbp)
}

/* The MSG VIP JBPacks this showing jbpacks*/
public JailbreakVIPPacks(id)
{
    new 
players[32],numi,id

    get_players
(players,num,"a")
    
    for(
i=0;i<num;i++)
    {
        
id players[i]
        if(
get_user_flags(id) & ADMIN_LEVEL_H
        {
            
set_hudmessage(142239390.850.7306.012.0)
            
ShowSyncHudMsg(idsyncObj,"VIP JBPacks: %i"g_jbpacks[id])
        }
    }
}

/* VIP Glow */
public glow_change(id)
{
    new 
players[32],numi,idcolor

    get_players
(players,num,"a")
    
    for(
i=0;i<num;i++)
    {
        
id players[i]
        if(
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            
color = ++current_color[id]
            
            if(
color == sizeof g_const_colorscolor current_color[id] = 0
            
            set_user_rendering
(idkRenderFxGlowShellg_const_colors[color][0],g_const_colors[color][1],g_const_colors[color][2])
        }
    }



Igor69 01-10-2019 08:41

Re: How to delete vip 2x dmg
 
Quote:

vip_dmg_power = register_cvar("jbe_vip_dmg_power", "2.0")
maybe set to 0?

Nutu_ 01-10-2019 10:09

Re: How to delete vip 2x dmg
 
or delete
PHP Code:

/* VIP Bullet Damage */ 
public event_damage(vip)  
{  
    if(
get_pcvar_num(vip_bullet_dmg) > 0
    { 
        new 
attacker =get_user_attacker(vip
        new 
damage read_data(2
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H)  
        { 
        
set_hudmessage(0100200, -1.00.7320.14.00.020.027
        
show_hudmessage(attacker,"You deal:%i damage"damage
        } 
    } 



Mikaeel123 01-10-2019 10:56

Re: How to delete vip 2x dmg
 
Thanks for Help :X

eat1k 01-10-2019 12:10

Re: How to delete vip 2x dmg
 
Quote:

Originally Posted by Nutu_ (Post 2633979)
or delete
PHP Code:

/* VIP Bullet Damage */ 
public event_damage(vip)  
{  
    if(
get_pcvar_num(vip_bullet_dmg) > 0
    { 
        new 
attacker =get_user_attacker(vip
        new 
damage read_data(2
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H)  
        { 
        
set_hudmessage(0100200, -1.00.7320.14.00.020.027
        
show_hudmessage(attacker,"You deal:%i damage"damage
        } 
    } 



The plugin won't work if you delete only this. Btw, this shows the damage, that doesn't increase it.

Nutu_ 01-10-2019 12:11

Re: How to delete vip 2x dmg
 
also this xd
PHP Code:

    if(is_user_connected(attacker) && get_user_flags(attacker) && ADMIN_LEVEL_H && cs_get_user_team(attacker) == CS_TEAM_CT
    { 
            
SetHamParamFloat(4,damage get_pcvar_num(vip_dmg_power)) 
    } 


eat1k 01-10-2019 15:26

Re: How to delete vip 2x dmg
 
Quote:

Originally Posted by Nutu_ (Post 2633994)
also this xd
PHP Code:

    if(is_user_connected(attacker) && get_user_flags(attacker) && ADMIN_LEVEL_H && cs_get_user_team(attacker) == CS_TEAM_CT
    { 
            
SetHamParamFloat(4,damage get_pcvar_num(vip_dmg_power)) 
    } 


The same, it won't work if you delete only this, you need to delete:

Actually, you can add a condition if the CVar jbe_vip_dmg_power is > 0 so the damage will be increased. Change player_take_damage() to this:
PHP Code:

/* VIP No Fall DMG + 2x DMG on CT */ 
public player_take_damage(victiminflictorattackerFloat:damagedamage_bits
{
    new 
iDamage get_pcvar_num(vip_dmg_power);

    if(
get_user_flags(attacker) && ADMIN_LEVEL_H && cs_get_user_team(attacker) == CS_TEAM_CT && iDamage 0
        
SetHamParamFloat(4damage iDamage);


Then set jbe_vip_dmg_power to 0.

Mikaeel123 01-11-2019 02:46

Re: How to delete vip 2x dmg
 
Quote:

Then set jbe_vip_dmg_power to 0.
yea i change this

eat1k 01-11-2019 06:06

Re: How to delete vip 2x dmg
 
Quote:

Originally Posted by Mikaeel123 (Post 2634116)
yea i change this

So? If you did everything I said, it should work.

Mikaeel123 01-11-2019 12:15

Re: How to delete vip 2x dmg
 
Yes it worked


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

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