Raised This Month: $ Target: $400
 0% 

Shop plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KeDa2
Junior Member
Join Date: Dec 2014
Old 12-06-2014 , 11:25   Shop plugin
Reply With Quote #1

Hey guys! Can a good coder please help me with my shop plugin?


"100 Extra HP" //Chat Print for you "You bought 100 extra HP for xx Dollars!"
"100 Extra armor" //Chat Print for you "You bought 100 extra armor for xx Dollars!"
"Inivisibility" //(99%, last's till death) Chat Print for you "You bought Invisibility for xx Dollars!"
"Low gravity"(Last's till death) //Chat Print for you "You bought Low gravity for xx Dollars!"
"Bomber (you get 10x HE)" //Chat Print for you "You bought Bomber for xx Dollars!"
"Faster Speed" (Last's till death) //Chat Print for you "You bought Faster Speed for xx Dollars!"
"Silent Footsteps" (Last's till death) //Chat Print for you "You bought Silent Footsteps for xx Dollars!"
"All Grenades"//Chat Print for you "You bought All Grenades for xx Dollars!"
"Double Damage"//Chat Print for you "You bought Double Damage for xx Dollars!"
"Armor Regeneration"//Chat Print for you "You bought Armor Regeneration for xx Dollars!"
"GodMode" (Last's 30 seconds)//Chat Print for you "You bought GodMode for xx Dollars!"
"Health Regeneration"//Chat Print for you "You bought Health Regeneration for xx Dollars!"
"Transparency"//Chat Print for you "You bought Transparency for xx Dollars!"
"Chameleon"//Chat Print for you "You bought Chameleon for xx Dollars!"

Would appreciate it! Thanks
KeDa2 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-06-2014 , 12:10   Re: Shop plugin
Reply With Quote #2

Just read this tutorial: https://forums.alliedmods.net/showthread.php?t=213223

Then, you can use this plugin for the items: https://forums.alliedmods.net/showthread.php?t=245805
zmd94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-06-2014 , 13:04   Re: Shop plugin
Reply With Quote #3

No author would do for you a free plugin
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 12-06-2014 , 14:49   Re: Shop plugin
Reply With Quote #4

1- you don't give all information like price .... etc
2- I don't add Chameleon
PHP Code:
//Generated By : Smart Shop Generator By EaGle

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

#define PLUGIN "Shop Menu"
#define VERSION "1.0"
#define AUTHOR "Me"

new g_iBlinkAcct;
new 
bool:g_CanUse[33]

new 
g_szItems[][] = {
    
"100 Extra HP",
    
"100 Extra armor",
    
"ivisibility",
    
"Low gravity",
    
"Bomber (you get 10x HE)",
    
"Faster Speed",
    
"Silent Footsteps",
    
"All Grenades",
    
"Double Damage",
    
"Armor Regeneration",
    
"GodMode",
    
"Health Regeneration",
    
"Transparency",
    
"Chameleon"
}

new 
g_iItemsPrices[] ={ 
    
1000//Price Of 100 Extra HP
    
1000//Price Of 100 Extra armor
    
3000//Price Of ivisibility
    
4000//Price Of Low gravity
    
12000//Price Of Bomber
    
8000//Price Of Faster Speed
    
2000//Price Of Silent Footsteps
    
15000//Price Of All Grenades
    
6000//Price Of Double Damage
    
3000//Price Of Armor Regeneration
    
9000//Price Of GodMode
    
7000//Price Of Health Regeneration
    
8000//Price Of Transparency
    
3000//Price Of Chameleon
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_iBlinkAcct get_user_msgid("BlinkAcct")

    
register_clcmd("say /shop","cmd_shop")
    
    
RegisterHam Ham_TakeDamage"player""fw_PlayerTakeDamage_Post")
}
public 
cmd_shop(id)
{
    new 
Temp[101], money cs_get_user_money(id)
    
formatex(Temp,100"Shop Menu");
    new 
menu menu_create(Temp,"shop_handler")
    new 
szItemName[64]
    for(new 
ii<sizeof(g_szItems) && i<sizeof(g_iItemsPrices); i++) 
    {
        if( 
money g_iItemsPrices[i] ) 
        {
            
formatex(szItemNamecharsmax(szItemName),"\d%s ($%d)"g_szItems], g_iItemsPrices]) 
        }
        else
        {
            
formatex(szItemNamecharsmax(szItemName),"%s (\r$%d\w)"g_szItems], g_iItemsPrices])
        }
        
menu_additem(menuszItemName)
    }
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED
}

public 
shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
money cs_get_user_money(id);
    new 
new_money cs_get_user_money(id) - g_iItemsPrices[item];

    if( 
money g_iItemsPrices[item] )
    {
        
NotEnoughMoneyid );
        
menu_display(idmenu);
        return 
PLUGIN_HANDLED;
    }

    switch(
item)
    {
        case 
0:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_health(id,get_user_health(id) + 100);
            
            
cs_set_user_money(idnew_money);
        }
        case 
1:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_armor(id,get_user_armor(id) + 100);
            
            
cs_set_user_money(idnew_money);
        }
        case 
2:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_renderingidkRenderFxNone000kRenderTransAlpha24 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
3:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_gravityid0.6 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
4:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
give_item(id,"weapon_hegrenade");
            
cs_set_user_bpammo(id,CSW_HEGRENADE10 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
5:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_maxspeed(id600.0)
            
            
cs_set_user_money(idnew_money);
        }
        case 
6:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_footsteps(id,1)
            
            
cs_set_user_money(idnew_money);
        }
        case 
7:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
give_item(id"weapon_hegrenade")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"weapon_flashbang")
            
            
cs_set_user_money(idnew_money);
        }
        case 
8:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
g_CanUse[id] = true
            
            cs_set_user_money
(idnew_money);
        }
        case 
9:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_task(1.0,"reg_armor",id)
            
            
cs_set_user_money(idnew_money);
        }
        case 
10:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_godmode(id,1)
            
            
cs_set_user_money(idnew_money);
        }
        case 
11:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_task(1.0,"reg_health",id)
            
            
cs_set_user_money(idnew_money);
        }
        case 
12:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_rendering(idkRenderFxNone000kRenderTransAlpha38)
            
            
cs_set_user_money(idnew_money);
        }
        case 
13:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
//....
            
            
cs_set_user_money(idnew_money);
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
reg_armor(id)
{
    
set_user_armor(id,get_user_armor(id) + 10);
    
set_task(5.0,"reg_armor",id)
}

public 
reg_health(id)
{
    
set_user_health(id,get_user_health(id) + 10);
    
set_task(5.0,"reg_health",id)
}

public 
fw_PlayerTakeDamage_Post VictimInflictorAttackerFloat:DamageDmg_Bits )
{
    if ( !
is_user_connected Attacker ) || !is_user_connected Victim ) )    
        return
        
    if ( !
g_CanUse Attacker ] )
        return
    
    
SetHamParamFloat 4Damage 2.0 )
}

NotEnoughMoney(id)
{
    
client_print(idprint_center,"#Cstrike_TitlesTXT_Not_Enough_Money");
    
message_begin(MSG_ONE_UNRELIABLEg_iBlinkAcct, .player=id);
    {
        
write_byte(2);
    }
    
message_end(); 

__________________
Eagle07 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-06-2014 , 21:38   Re: Shop plugin
Reply With Quote #5

Other suggestion is you can use set_pev(id, pev_health, floatmin(pev(id, pev_health) + 10.0, 100.0)) for health regeneration.

While set_pev(id, pev_armorvalue, floatmin(pev(id, pev_armorvalue) + 10.0, 100.0)) for armor regeneration.

This will ensure the health and armor regeneration will not exceed the limit value. In this case, the limit value is "100". ;)

Yet, you need to #include <fakemeta>.

Last edited by zmd94; 12-08-2014 at 01:43.
zmd94 is offline
KeDa2
Junior Member
Join Date: Dec 2014
Old 12-07-2014 , 05:29   Re: Shop plugin
Reply With Quote #6

Dude youre awesome. Thanks. But still i dont get, how do i make some of the items last till death?

Quote:
Originally Posted by Eagle07 View Post
1- you don't give all information like price .... etc
2- I don't add Chameleon
PHP Code:
//Generated By : Smart Shop Generator By EaGle

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

#define PLUGIN "Shop Menu"
#define VERSION "1.0"
#define AUTHOR "Me"

new g_iBlinkAcct;
new 
bool:g_CanUse[33]

new 
g_szItems[][] = {
    
"100 Extra HP",
    
"100 Extra armor",
    
"ivisibility",
    
"Low gravity",
    
"Bomber (you get 10x HE)",
    
"Faster Speed",
    
"Silent Footsteps",
    
"All Grenades",
    
"Double Damage",
    
"Armor Regeneration",
    
"GodMode",
    
"Health Regeneration",
    
"Transparency",
    
"Chameleon"
}

new 
g_iItemsPrices[] ={ 
    
1000//Price Of 100 Extra HP
    
1000//Price Of 100 Extra armor
    
3000//Price Of ivisibility
    
4000//Price Of Low gravity
    
12000//Price Of Bomber
    
8000//Price Of Faster Speed
    
2000//Price Of Silent Footsteps
    
15000//Price Of All Grenades
    
6000//Price Of Double Damage
    
3000//Price Of Armor Regeneration
    
9000//Price Of GodMode
    
7000//Price Of Health Regeneration
    
8000//Price Of Transparency
    
3000//Price Of Chameleon
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_iBlinkAcct get_user_msgid("BlinkAcct")

    
register_clcmd("say /shop","cmd_shop")
    
    
RegisterHam Ham_TakeDamage"player""fw_PlayerTakeDamage_Post")
}
public 
cmd_shop(id)
{
    new 
Temp[101], money cs_get_user_money(id)
    
formatex(Temp,100"Shop Menu");
    new 
menu menu_create(Temp,"shop_handler")
    new 
szItemName[64]
    for(new 
ii<sizeof(g_szItems) && i<sizeof(g_iItemsPrices); i++) 
    {
        if( 
money g_iItemsPrices[i] ) 
        {
            
formatex(szItemNamecharsmax(szItemName),"\d%s ($%d)"g_szItems], g_iItemsPrices]) 
        }
        else
        {
            
formatex(szItemNamecharsmax(szItemName),"%s (\r$%d\w)"g_szItems], g_iItemsPrices])
        }
        
menu_additem(menuszItemName)
    }
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED
}

public 
shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
money cs_get_user_money(id);
    new 
new_money cs_get_user_money(id) - g_iItemsPrices[item];

    if( 
money g_iItemsPrices[item] )
    {
        
NotEnoughMoneyid );
        
menu_display(idmenu);
        return 
PLUGIN_HANDLED;
    }

    switch(
item)
    {
        case 
0:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_health(id,get_user_health(id) + 100);
            
            
cs_set_user_money(idnew_money);
        }
        case 
1:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_armor(id,get_user_armor(id) + 100);
            
            
cs_set_user_money(idnew_money);
        }
        case 
2:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_renderingidkRenderFxNone000kRenderTransAlpha24 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
3:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_gravityid0.6 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
4:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
give_item(id,"weapon_hegrenade");
            
cs_set_user_bpammo(id,CSW_HEGRENADE10 );
            
            
cs_set_user_money(idnew_money);
        }
        case 
5:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_maxspeed(id600.0)
            
            
cs_set_user_money(idnew_money);
        }
        case 
6:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_footsteps(id,1)
            
            
cs_set_user_money(idnew_money);
        }
        case 
7:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
give_item(id"weapon_hegrenade")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"weapon_flashbang")
            
            
cs_set_user_money(idnew_money);
        }
        case 
8:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
g_CanUse[id] = true
            
            cs_set_user_money
(idnew_money);
        }
        case 
9:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_task(1.0,"reg_armor",id)
            
            
cs_set_user_money(idnew_money);
        }
        case 
10:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_godmode(id,1)
            
            
cs_set_user_money(idnew_money);
        }
        case 
11:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_task(1.0,"reg_health",id)
            
            
cs_set_user_money(idnew_money);
        }
        case 
12:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
set_user_rendering(idkRenderFxNone000kRenderTransAlpha38)
            
            
cs_set_user_money(idnew_money);
        }
        case 
13:
        {
            
client_print(idprint_chat,"You Bought %s For %d $"g_szItems[item],g_iItemsPrices[item]);
            
            
//....
            
            
cs_set_user_money(idnew_money);
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
reg_armor(id)
{
    
set_user_armor(id,get_user_armor(id) + 10);
    
set_task(5.0,"reg_armor",id)
}

public 
reg_health(id)
{
    
set_user_health(id,get_user_health(id) + 10);
    
set_task(5.0,"reg_health",id)
}

public 
fw_PlayerTakeDamage_Post VictimInflictorAttackerFloat:DamageDmg_Bits )
{
    if ( !
is_user_connected Attacker ) || !is_user_connected Victim ) )    
        return
        
    if ( !
g_CanUse Attacker ] )
        return
    
    
SetHamParamFloat 4Damage 2.0 )
}

NotEnoughMoney(id)
{
    
client_print(idprint_center,"#Cstrike_TitlesTXT_Not_Enough_Money");
    
message_begin(MSG_ONE_UNRELIABLEg_iBlinkAcct, .player=id);
    {
        
write_byte(2);
    }
    
message_end(); 

KeDa2 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-07-2014 , 05:34   Re: Shop plugin
Reply With Quote #7

This plugin already does as your request.
zmd94 is offline
KeDa2
Junior Member
Join Date: Dec 2014
Old 12-07-2014 , 05:47   Re: Shop plugin
Reply With Quote #8

Gravity was gone the next round and speed lasted for about a minute...

Quote:
Originally Posted by zmd94 View Post
This plugin already does as your request.
KeDa2 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-07-2014 , 06:33   Re: Shop plugin
Reply With Quote #9

Just add bool when player bought the item. In the next round, if the bool is true, then give again the item for free. ;)

While set_user_maxspeed(id, 600.0), may not the best way to set the player speed. Just use this: https://forums.alliedmods.net/showpo...2&postcount=11

Last edited by zmd94; 12-07-2014 at 06:35.
zmd94 is offline
KeDa2
Junior Member
Join Date: Dec 2014
Old 12-07-2014 , 08:14   Re: Shop plugin
Reply With Quote #10

Maybe it would be easier to edit this plugin with my needs? Im totaly new at this, and dont even know what a ''bool'' is. There are only few thing i need. Invisibility 99% (last's till death), Gravity (last's till death), Transparency, double damage, speed (also last's till death). I know its pretty much to ask. but trust me man, if i could do it myself, i wouldnt bother any of you ;)


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN_NAME "Shop"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR "NEC"

#define SHOP_ACCESS ADMIN_RESERVATION
#define m_pActiveItem 373

#define sNo "buttons/button11.wav"
#define sOver "buttons/blip2.wav"

new const szPrefix[] = "NEC Shop"

enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

new const 
g_playerModels[][] = {
    
"arctic",
    
"guerilla",
    
"leet",
    
"terror",
    
"gign",
    
"gsg9",
    
"sas",
    
"urban"
}

new const 
g_itemSounds[][] = {
    
"items/smallmedkit1.wav"// Item "a": +50 Health [1000$]
    
"items/ammopickup2.wav"// Item "b": +50 Armor [1000$]
    
"items/gunpickup2.wav"// Item "c": Unlimited Clip [3000$]
    
"items/gunpickup2.wav"// Item "d": Unlimited Ammo [200$]
    
"items/gunpickup2.wav"// Item "e": All Grenades [800$]
    
"x/x_pain2.wav"// Item "f": Bomber [1600$]
    
"items/gunpickup2.wav"// Item "g": Silent Footsteps [3000$]
    
"misc/bipbip.wav"// Item "h": Faster Speed [4300$]
    
"items/gunpickup2.wav"// Item "i": Low Gravity [2800$]
    
"items/gunpickup2.wav"// Item "j": Chameleon [9000$]
    
"items/gunpickup2.wav"// Item "k": Drugs (Speed + Health) [8000$]
    
"items/gunpickup2.wav"// Item "l": Transparency [2500$]
    
"hornet/ag_buzz1.wav"// Item "m": Invisibility (15 Seconds) [16000$]
    
"items/gunpickup2.wav"// Item "n": Double Damage [10000$]
    
"misc/stinger12.wav"// Item "o": GodMode (30 Seconds) [16000$]
    
"items/suitchargeok1.wav"// Item "p": Health Regeneration [1800$]
    
"items/suitchargeok1.wav" // Item "q": Armor Regeneration [2000$]
}

new 
DisabledItemsVIPOnlygmsg_SetFOV
new HealthAmmountHealthPrizeArmorAmmountArmorPrizeUnlimitedClipPrizeUnlimitedAmmoPrizeAllGrenadesPrizeBomberPrizeBomberAmmountSilentFootstepsPrize
new FasterSpeedAmmountFasterSpeedPrizeLowGravityAmmountLowGravityPrizeChameleonPrizeDrugsSpeedAmmountDrugsHealthAmmountDrugsPrize
new TransparencyAmmountTransparencyPrizeInvisibilityTimeInvisibilityPrizeDoubleDamagePrizeGodModeTimeGodModePrizeHealthRegenAmmountHealthRegenTime
new HealthRegenMaxHealthRegenPrizeArmorRegenAmmountArmorRegenTimeArmorRegenMaxArmorRegenPrize
new InfoMessageEnabledInfoMessageTimeShopEquip

new cantactivate[33]
new 
cshop_speed[33], cshop_ddamage[33], cshop_healthregen[33], cshop_armorregen[33]

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_dictionary("custom_shop.txt")
    
    
register_event("CurWeapon""change_weapon""be""1=1")
    
RegisterHam(Ham_Spawn"player""ham_spawn"1)
    
RegisterHam(Ham_TakeDamage"player""ham_damage")
    
    
register_clcmd("say /shop""cshop_main")
    
register_clcmd("say_team /shop""cshop_main")
    
    
DisabledItems register_cvar("customshop_disableditems""")
    
VIPOnly register_cvar("customshop_viponly""0")
    
    
HealthAmmount register_cvar("customshop_health_ammount""50")
    
HealthPrize register_cvar("customshop_health_prize""1500")
    
ArmorAmmount register_cvar("customshop_armor_ammount""100")
    
ArmorPrize register_cvar("customshop_armor_prize""1000")
    
UnlimitedClipPrize register_cvar("customshop_unlclip_prize""3000")
    
UnlimitedAmmoPrize register_cvar("customshop_unlammo_prize""200")
    
AllGrenadesPrize register_cvar("customshop_allgrenades_prize""800")
    
BomberPrize register_cvar("customshop_bomber_prize""1600")
    
BomberAmmount register_cvar("customshop_bomber_ammount""20")
    
SilentFootstepsPrize register_cvar("customshop_silentsteps_prize""3000")
    
FasterSpeedAmmount register_cvar("customshop_fasterspeed_ammount""300.0")
    
FasterSpeedPrize register_cvar("customshop_fasterspeed_prize""4300")
    
LowGravityAmmount register_cvar("customshop_lowgravity_ammount""0.5")
    
LowGravityPrize register_cvar("customshop_lowgravity_prize""2800")
    
ChameleonPrize register_cvar("customshop_chameleon_prize""9000")
    
DrugsSpeedAmmount register_cvar("customshop_drugs_speedammount""300.0")
    
DrugsHealthAmmount register_cvar("customshop_drugs_healthammount""200")
    
DrugsPrize register_cvar("customshop_drugs_prize""8000")
    
TransparencyAmmount register_cvar("customshop_transparency_ammount""75")
    
TransparencyPrize register_cvar("customshop_transparency_prize""2500")
    
InvisibilityTime register_cvar("customshop_invisibility_time""15.0")
    
InvisibilityPrize register_cvar("customshop_invisibility_prize""16000")
    
DoubleDamagePrize register_cvar("customshop_doubledamage_prize""10000")
    
GodModeTime register_cvar("customshop_godmode_time""5.0")
    
GodModePrize register_cvar("customshop_godmode_prize""16000")
    
HealthRegenAmmount register_cvar("customshop_healthregen_ammount""1")
    
HealthRegenTime register_cvar("customshop_healthregen_time""0.5")
    
HealthRegenMax register_cvar("customshop_healthregen_max""150")
    
HealthRegenPrize register_cvar("customshop_healthregen_prize""1800")
    
ArmorRegenAmmount register_cvar("customshop_armorregen_ammount""10")
    
ArmorRegenTime register_cvar("customshop_armorregen_time""0.5")
    
ArmorRegenMax register_cvar("customshop_armorregen_max""150")
    
ArmorRegenPrize register_cvar("customshop_armorregen_prize""2000")
    
InfoMessageEnabled register_cvar("customshop_infomessage_enabled""1")
    
InfoMessageTime register_cvar("customshop_infomessage_time""90.0")
    
ShopEquip register_cvar("customshop_buyequip""1")
    
    if(
get_pcvar_num(ShopEquip) == 1register_clcmd("buyequip""cshop_main")
    
    
gmsg_SetFOV get_user_msgid("SetFOV")
    if(
get_pcvar_num(InfoMessageEnabled) == 1set_task(get_pcvar_float(InfoMessageTime), "infoMessage"1111""0"b"0)
}

public 
client_putinserver(id)
{
    
cshop_speed[id] = false
    cshop_ddamage
[id] = false
    cshop_healthregen
[id] = false
    cshop_armorregen
[id] = false
}


public 
ham_spawn(id)
{
    
    
cshop_ddamage[id] = false
    cshop_healthregen
[id] = false
    cshop_armorregen
[id] = false
    
if(is_user_alive(id))
    {
        
set_user_footsteps(id0)
        
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha255)
    }
    if(
is_user_connected(id)) cs_reset_user_model(id)
}

public 
change_weapon(id)
{
    if(
cshop_speed[id]) set_user_maxspeed(idget_pcvar_float(FasterSpeedAmmount))
}

public 
infoMessage()
    
ColorChat(0TEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_INFO"PLUGIN_NAMEPLUGIN_AUTHOR)

public 
cshop_main(id)
{
    if(
get_pcvar_num(VIPOnly) == 1)
    {
        if(!(
get_user_flags(id) & SHOP_ACCESS))
        {
            
ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_NOACCESS")
            
client_cmd(id"spk %s"sNo)
            return 
PLUGIN_HANDLED
        
}
    }
    
    if(!
is_user_alive(id))
    {
        
ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_NOTALIVE")
        
client_cmd(id"spk %s"sNo)
        return 
PLUGIN_HANDLED
    
}
    
    new 
menu_title[200], items[30]
    new 
money cs_get_user_money(id)
    
get_pcvar_string(DisabledItemsitems29)
    
    
formatex(menu_titlecharsmax(menu_title), "\yNEC \yShop^n\w%L: \r%i \d| \w%L:\d"LANG_SERVER"CSHOP_MONEY"moneyLANG_SERVER"CSHOP_PAGE")
    new 
customshop menu_create(menu_title"cshop_handler")
    
    new 
item[80], close[15], back[15], next[15]
    
    if(
contain(items"a") == -1// Item "a": +50 Health [1000$]
    
{
        if(
money >= get_pcvar_num(HealthPrize)) formatex(itemcharsmax(item), "+\y%i \w%L \r[%i$]"get_pcvar_num(HealthAmmount), LANG_SERVER"CSHOP_HEALTH"get_pcvar_num(HealthPrize))
        else 
formatex(itemcharsmax(item), "\d+%i %L \r[%i$]"get_pcvar_num(HealthAmmount), LANG_SERVER"CSHOP_HEALTH"get_pcvar_num(HealthPrize))
        
menu_additem(customshopitem"0"0)
    }
    
    if(
contain(items"b") == -1// Item "b": +50 Armor [1000$]
    
{
        if(
money >= get_pcvar_num(ArmorPrize)) formatex(itemcharsmax(item), "+\y%i \w%L \r[%i$]"get_pcvar_num(ArmorAmmount), LANG_SERVER"CSHOP_ARMOR"get_pcvar_num(ArmorPrize))
        else 
formatex(itemcharsmax(item), "\d+%i %L \r[%i$]"get_pcvar_num(ArmorAmmount), LANG_SERVER"CSHOP_ARMOR"get_pcvar_num(ArmorPrize))
        
menu_additem(customshopitem"1"0)
    }    
    
    if(
contain(items"c") == -1// Item "c": Unlimited Clip [3000$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(UnlimitedClipPrize)) ? "" "\d"LANG_SERVER"CSHOP_UNLCLIP"get_pcvar_num(UnlimitedClipPrize))
        
menu_additem(customshopitem"2"0)
    }
    
    if(
contain(items"d") == -1// Item "d": Unlimited Ammo [200$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(UnlimitedAmmoPrize)) ? "" "\d"LANG_SERVER"CSHOP_UNLAMMO"get_pcvar_num(UnlimitedAmmoPrize))  
        
menu_additem(customshopitem"3"0)
    }    
    
    if(
contain(items"e") == -1// Item "e": All Grenades [800$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(AllGrenadesPrize)) ? "" "\d"LANG_SERVER"CSHOP_ALLGRENADES"get_pcvar_num(AllGrenadesPrize))
        
menu_additem(customshopitem"4"0)
    }    
    
    if(
contain(items"f") == -1// Item "f": Bomber [1600$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(BomberPrize)) ? "" "\d"LANG_SERVER"CSHOP_BOMBER"get_pcvar_num(BomberPrize))
        
menu_additem(customshopitem"5"0)
    }    
    
    if(
contain(items"g") == -1// Item "g": Silent Footsteps [3000$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(SilentFootstepsPrize)) ? "" "\d"LANG_SERVER"CSHOP_SILENTSTEPS"get_pcvar_num(SilentFootstepsPrize))
        
menu_additem(customshopitem"6"0)
    }    
    
    if(
contain(items"h") == -1// Item "h": Faster Speed [4300$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(FasterSpeedPrize)) ? "" "\d"LANG_SERVER"CSHOP_FASTERSPEED"get_pcvar_num(FasterSpeedPrize))
        
menu_additem(customshopitem"7"0)
    }    
    
    if(
contain(items"i") == -1// Item "i": Low Gravity [2800$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(LowGravityPrize)) ? "" "\d"LANG_SERVER"CSHOP_LOWGRAVITY"get_pcvar_num(LowGravityPrize))
        
menu_additem(customshopitem"8"0)
    }
    
    if(
contain(items"j") == -1// Item "j": Chameleon [9000$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(ChameleonPrize)) ? "" "\d"LANG_SERVER"CSHOP_CHAMELEON"get_pcvar_num(ChameleonPrize))
        
menu_additem(customshopitem"9"0)
    }    
    
    if(
contain(items"k") == -1// Item "k": Drugs (Speed + Health) [8000$]
    
{
        if(
money >= get_pcvar_num(DrugsPrize)) formatex(itemcharsmax(item), "%L \y(%L) \r[%i$]"LANG_SERVER"CSHOP_DRUGS"LANG_SERVER"CSHOP_DRUGS2"get_pcvar_num(DrugsPrize))
        else 
formatex(itemcharsmax(item), "\d%L (%L) \r[%i$]"LANG_SERVER"CSHOP_DRUGS"LANG_SERVER"CSHOP_DRUGS2"get_pcvar_num(DrugsPrize))
        
menu_additem(customshopitem"10"0)
    }    
    
    if(
contain(items"l") == -1// Item "l": Transparency [2500$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(TransparencyPrize)) ? "" "\d"LANG_SERVER"CSHOP_TRANSPARENCY"get_pcvar_num(TransparencyPrize))
        
menu_additem(customshopitem"11"0)
    }    
    
    if(
contain(items"m") == -1// Item "m": Invisibility (15 Seconds) [16000$]
    
{
        if(
money >= get_pcvar_num(InvisibilityPrize)) formatex(itemcharsmax(item), "%L \y(%i %L) \r[%i$]"LANG_SERVER"CSHOP_INVISIBILITY"get_pcvar_num(InvisibilityTime), LANG_SERVER"CSHOP_SECONDS"get_pcvar_num(InvisibilityPrize))
        else 
formatex(itemcharsmax(item), "\d%L (%i %L) \r[%i$]"LANG_SERVER"CSHOP_INVISIBILITY"get_pcvar_num(InvisibilityTime), LANG_SERVER"CSHOP_SECONDS"get_pcvar_num(InvisibilityPrize))
        
menu_additem(customshopitem"12"0)
    }    
    
    if(
contain(items"n") == -1// Item "n": Double Damage [10000$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(DoubleDamagePrize)) ? "" "\d"LANG_SERVER"CSHOP_DDAMAGE"get_pcvar_num(DoubleDamagePrize))
        
menu_additem(customshopitem"13"0)
    }    
    
    if(
contain(items"o") == -1// Item "o": GodMode (5 Seconds) [16000$]
    
{
        if(
money >= get_pcvar_num(GodModePrize)) formatex(itemcharsmax(item), "%L \y(%i %L) \r[%i$]"LANG_SERVER"CSHOP_GODMODE"get_pcvar_num(GodModeTime), LANG_SERVER"CSHOP_SECONDS"get_pcvar_num(GodModePrize))
        else 
formatex(itemcharsmax(item), "\d%L (%i %L) \r[%i$]"LANG_SERVER"CSHOP_GODMODE"get_pcvar_num(GodModeTime), LANG_SERVER"CSHOP_SECONDS"get_pcvar_num(GodModePrize))
        
menu_additem(customshopitem"14"0)
    }    
    
    if(
contain(items"p") == -1// Item "p": Health Regeneration [1800$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(HealthRegenPrize)) ? "" "\d"LANG_SERVER"CSHOP_HEALTHREGEN"get_pcvar_num(HealthRegenPrize))
        
menu_additem(customshopitem"15"0)
    }    
    
    if(
contain(items"q") == -1// Item "q": Armor Regeneration [2000$]
    
{
        
formatex(itemcharsmax(item), "%s%L \r[%i$]", (money >= get_pcvar_num(ArmorRegenPrize)) ? "" "\d"LANG_SERVER"CSHOP_ARMORREGEN"get_pcvar_num(ArmorRegenPrize))
        
menu_additem(customshopitem"16"0)
    }    
    
    
formatex(closecharsmax(close), "%L"LANG_SERVER"CSHOP_EXIT")
    
formatex(backcharsmax(back), "%L"LANG_SERVER"CSHOP_BACK")
    
formatex(nextcharsmax(next), "%L"LANG_SERVER"CSHOP_NEXT")
    
    
menu_setprop(customshopMPROP_EXITNAMEclose)
    
menu_setprop(customshopMPROP_BACKNAMEback)
    
menu_setprop(customshopMPROP_NEXTNAMEnext)
    
    
menu_display(idcustomshop0)
    return 
PLUGIN_HANDLED
}

public 
cshop_handler(idcustomshopitem)
{
    if(!
is_user_alive(id) || item == MENU_EXIT)
    {
        
menu_destroy(customshop)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(customshopitemaccessdatacharsmax(data), iNamecharsmax(iName), callback)

    new 
key str_to_num(data)
    new 
money cs_get_user_money(id)
    new 
weapon get_user_weapon(id)
    new 
message[192]
    
    switch(
key)
    {
        case 
0// Item "a": +50 Health [1000$]
        
{
            if(
money >= get_pcvar_num(HealthPrize))
            {
                
set_user_health(idget_user_health(id) + get_pcvar_num(HealthAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(HealthPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_HEALTH"get_pcvar_num(HealthPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
1// Item "b": +50 Armor [1000$]
        
{
            if(
money >= get_pcvar_num(ArmorPrize))
            {
                
set_user_armor(idget_user_armor(id) + get_pcvar_num(ArmorAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(ArmorPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_ARMOR"get_pcvar_num(ArmorPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
2// Item "c": Unlimited Clip [3000$]
        
{
            if(
money >= get_pcvar_num(UnlimitedClipPrize))
            {
                if(
weapon != CSW_KNIFE && weapon != CSW_HEGRENADE && weapon != CSW_FLASHBANG && weapon != CSW_SMOKEGRENADE && weapon != CSW_C4)
                {
                    
cs_set_weapon_ammo(get_pdata_cbase(idm_pActiveItem), 97280)
                    
cs_set_user_bpammo(idweapon0)
                    
cs_set_user_money(idmoney get_pcvar_num(UnlimitedClipPrize), 1)
                    
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_UNLCLIP"get_pcvar_num(UnlimitedClipPrize))
                }
                else
                {
                    
cantactivate[id] = 1
                    cantactivateitem
(id)
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
3// Item "d": Unlimited Ammo [200$]
        
{
            if(
money >= get_pcvar_num(UnlimitedAmmoPrize))
            {
                if(
weapon != CSW_KNIFE && weapon != CSW_HEGRENADE && weapon != CSW_FLASHBANG && weapon != CSW_SMOKEGRENADE && weapon != CSW_C4)
                {
                    
cs_set_user_bpammo(idweapon99999)
                    
cs_set_user_money(idmoney get_pcvar_num(UnlimitedAmmoPrize), 1)
                    
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_UNLAMMO"get_pcvar_num(UnlimitedAmmoPrize))
                }
                else
                {
                    
cantactivate[id] = 2
                    cantactivateitem
(id)
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
4// Item "e": All Grenades [800$]
        
{
            if(
money >= get_pcvar_num(AllGrenadesPrize))
            {
                
give_item(id"weapon_hegrenade")
                
give_item(id"weapon_flashbang")
                
give_item(id"weapon_flashbang")
                
give_item(id"weapon_smokegrenade")
                
cs_set_user_money(idmoney get_pcvar_num(AllGrenadesPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_ALLGRENADES"get_pcvar_num(AllGrenadesPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
5// Item "f": Bomber [1600$]
        
{
            if(
money >= get_pcvar_num(BomberPrize))
            {
                
give_item(id"weapon_hegrenade")
                
cs_set_user_bpammo(idCSW_HEGRENADEget_pcvar_num(BomberAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(BomberPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_BOMBER"get_pcvar_num(BomberPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
6// Item "g": Silent Footsteps [3000$]
        
{
            if(
money >= get_pcvar_num(SilentFootstepsPrize))
            {
                
set_user_footsteps(id1)
                
cs_set_user_money(idmoney get_pcvar_num(SilentFootstepsPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_SILENTSTEPS"get_pcvar_num(SilentFootstepsPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
7// Item "h": Faster Speed [4300$]
        
{
            if(
money >= get_pcvar_num(FasterSpeedPrize))
            {
                
cshop_speed[id] = true
                set_user_maxspeed
(idget_pcvar_float(FasterSpeedAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(FasterSpeedPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_FASTERSPEED"get_pcvar_num(FasterSpeedPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
8// Item "i": Low Gravity [2800$]
        
{
            if(
money >= get_pcvar_num(LowGravityPrize))
            {
                
set_user_gravity(idget_pcvar_float(LowGravityAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(LowGravityPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_LOWGRAVITY"get_pcvar_num(LowGravityPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
9// Item "j": Chameleon [9000$]
        
{
            if(
money >= get_pcvar_num(ChameleonPrize))
            {
                switch(
get_user_team(id))
                {
                    case 
1cs_set_user_model(idg_playerModels[random_num(47)])
                    case 
2cs_set_user_model(idg_playerModels[random_num(03)])
                }
                
cs_set_user_money(idmoney get_pcvar_num(ChameleonPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_CHAMELEON"get_pcvar_num(ChameleonPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
10// Item "k": Drugs (Speed + Health) [8000$]
        
{
            if(
money >= get_pcvar_num(DrugsPrize))
            {
                
set_user_health(idget_pcvar_num(DrugsHealthAmmount))
                
set_user_maxspeed(idget_pcvar_float(DrugsSpeedAmmount))
                
message_begin(MSG_ONEgmsg_SetFOV, {000}, id)
                
write_byte(180)
                
message_end()
                
cs_set_user_money(idmoney get_pcvar_num(DrugsPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_DRUGS"get_pcvar_num(DrugsPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
11// Item "l": Transparency [2500$]
        
{
            if(
money >= get_pcvar_num(TransparencyPrize))
            {
                
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlphaget_pcvar_num(TransparencyAmmount))
                
cs_set_user_money(idmoney get_pcvar_num(TransparencyPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_TRANSPARENCY"get_pcvar_num(TransparencyPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
12// Item "m": Invisibility (15 Seconds) [16000$]
        
{
            if(
money >= get_pcvar_num(InvisibilityPrize))
            {
                
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
                
set_task(get_pcvar_float(InvisibilityTime), "NoMoreInvis"id)
                
cs_set_user_money(idmoney get_pcvar_num(InvisibilityPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_INVISIBILITY"get_pcvar_num(InvisibilityPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
13// Item "n": Double Damage [10000$]
        
{
            if(
money >= get_pcvar_num(DoubleDamagePrize))
            {
                
cshop_ddamage[id] = true
                cs_set_user_money
(idmoney get_pcvar_num(DoubleDamagePrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_DDAMAGE"get_pcvar_num(DoubleDamagePrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
14// Item "o": GodMode (5 Seconds) [16000$]
        
{
            if(
money >= get_pcvar_num(GodModePrize))
            {
                
set_user_godmode(id1)
                
set_task(get_pcvar_float(GodModeTime), "NoMoreGod"id)
                
cs_set_user_money(idmoney get_pcvar_num(GodModePrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_GODMODE"get_pcvar_num(GodModePrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
15// Item "p": Health Regeneration [1800$]
        
{
            if(
money >= get_pcvar_num(HealthRegenPrize))
            {
                
cshop_healthregen[id] = true
                set_task
(get_pcvar_float(HealthRegenTime), "healthRegenTicker"id""0"b"0)
                
cs_set_user_money(idmoney get_pcvar_num(HealthRegenPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_HEALTHREGEN"get_pcvar_num(HealthRegenPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
16// Item "q": Armor Regeneration [2000$]
        
{
            if(
money >= get_pcvar_num(ArmorRegenPrize))
            {
                
cshop_armorregen[id] = true
                set_task
(get_pcvar_float(ArmorRegenTime), "armorRegenTicker"id""0"b"0)
                
cs_set_user_money(idmoney get_pcvar_num(ArmorRegenPrize))
                
formatex(messagecharsmax(message), "%s ^1%L"szPrefixLANG_SERVER"CSHOP_BOUGHT"LANG_SERVER"CSHOP_ARMORREGEN"get_pcvar_num(ArmorRegenPrize))
            }
            else
            {
                
notenough(id)
                return 
PLUGIN_HANDLED
            
}
        }
    }
    
    
emit_sound(idCHAN_ITEMg_itemSounds[item], VOL_NORMATTN_NORM0PITCH_NORM)
    
ColorChat(idTEAM_COLORmessage)
    
    
menu_destroy(customshop)
    return 
PLUGIN_HANDLED
}

public 
notenough(id)
{
    
ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_NOTENOUGH")
    
client_cmd(id"spk %s"sNo)
}

public 
cantactivateitem(id)
{
    switch(
cantactivate[id])
    {
        case 
1ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_CANNOT_ACTIVATE"LANG_SERVER"CSHOP_UNLCLIP")
        case 
2ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_CANNOT_ACTIVATE"LANG_SERVER"CSHOP_UNLAMMO")
    }
    
client_cmd(id"spk %s"sNo)
}

public 
NoMoreInvis(id)
{
    
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha255)
    
ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_NOMOREINVIS")
    
client_cmd(id"spk %s"sOver)
}

public 
NoMoreGod(id)
{
    if(
is_user_alive(id)) set_user_godmode(id0)
    
ColorChat(idTEAM_COLOR"%s ^1%L"szPrefixLANG_SERVER"CSHOP_NOMOREGOD")
    
client_cmd(id"spk %s"sOver)
}

public 
ham_damage(victiminflictorattackerFloat:damagedamage_bits)
{
    if(
is_user_alive(attacker) && cshop_ddamage[attacker] && attacker != victim)
        
SetHamParamFloat(4damage 2)
}

public 
healthRegenTicker(id)
{
    if(!
is_user_alive(id) || !cshop_healthregen[id]) remove_task(id)
    
    new 
health get_user_health(id)
    new 
healthammount get_pcvar_num(HealthRegenAmmount)
    new 
healthmax get_pcvar_num(HealthRegenMax)
    
    if(
cshop_healthregen[id] && is_user_alive(id))
    {
        if(
health healthmax)
        {
            if(
health healthammount healthmaxset_user_health(idhealthmax)
            else 
set_user_health(idhealth healthammount)
        }
    }
}

public 
armorRegenTicker(id)
{
    if(!
is_user_alive(id) || !cshop_armorregen[id]) remove_task(id)
    
    new 
armor get_user_armor(id)
    new 
armorammount get_pcvar_num(ArmorRegenAmmount)
    new 
armormax get_pcvar_num(ArmorRegenMax)
        
    if(
cshop_armorregen[id] && is_user_alive(id))
    {
        if(
armor armormax)
        {
            if(
armor armorammount armormaxset_user_armor(idarmormax)
            else 
set_user_armor(idarmor armorammount)
        }
    }
}

public 
plugin_precache()
{
    for(new 
0sizeof g_itemSoundsi++)
        
precache_sound(g_itemSounds[i])
}

/* ======================================================================================================= */
/* ColorChat */
/* ======================================================================================================= */
ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    if( !
get_playersnum() ) return;
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
replace_all(message191"!n""^x01")
    
replace_all(message191"!t""^x03")
    
replace_all(message191"!g""^x04")
    
    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;

Quote:
Originally Posted by zmd94 View Post
Just add bool when player bought the item. In the next round, if the bool is true, then give again the item for free. ;)

While set_user_maxspeed(id, 600.0), may not the best way to set the player speed. Just use this: https://forums.alliedmods.net/showpo...2&postcount=11

Last edited by KeDa2; 12-07-2014 at 08:15.
KeDa2 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 03:39.


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