Първия проблем е, че след закупуването на GoldAk предишното оръжие остава, т.е можеш да ползваш и двете. Рових доста из интернет, но не успях да намеря решение на този проблем.
Втория проблем е, че не можах да открия /drop команда, която да дропва GoldAk-то от този plugin. Ако някой може да изработи тази команда ще съм му много благодарен.
Третия проблем е в no recoil, който е от същият plugin. Проблема е, че мерника ти адски много подскача след закупуването на no recoil-а.
Решение на няколко проблема в BB 6.5?
-
sf4n
Извън линия - Потребител
- Мнения: 311
- Регистриран на: 08 Яну 2018, 11:25
- Се отблагодари: 25 пъти
- Получена благодарност: 14 пъти
Решение на няколко проблема в BB 6.5?
Последно промяна от sf4n на 02 Май 2020, 21:10, променено общо 2 пъти.
Единствен по рода си Zombie BaseBuilder с уникален мод и коректни админи по всяко време в сървъра.
IP: bb.cs-zapad.eu:27013
Respawn сървър.
IP: re.cs-zapad.eu:27015
Furien сървър.
IP: fu.cs-zapad.eu:27016
Нашият Сайт
Нашият Форум
-
illusion
Извън линия - Developer
- Мнения: 1810
- Регистриран на: 27 Ное 2016, 17:47
- Местоположение: CraftVision
- Се отблагодари: 151 пъти
- Получена благодарност: 370 пъти
- Обратна връзка:
Решение на няколко проблема в BB 6.5?
Виж така дали първият проблем с оставането на предишните оръжия работи:
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <fakemeta>
#include <engine>
#include <xs>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif
#define MAX_PLAYERS 32
#define TASK 222333
#define m_pActiveItem 373
#define PLUGIN "Zombie BB Shop For 6.5 TIRANT"
#define VERSION "1.0"
#define AUTHOR "Just In Case"
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
#define IsPlayer1(%1) ( 1 <= %1 <= MAX_PLAYERS )
//CONFIG FILE
#define USE_CONFIG_FILE 1
// weapons offsets
#define OFFSET_CLIPAMMO 51
#define OFFSET_LINUX_WEAPONS 4
#define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new const szChatCommands[][] = {
"say /shop", "say_team /shop",
"say shop", "say_team shop",
"say /market", "say_team /market",
"say market", "say_team market"
}
new const szChatCheckCredits[][] = {
"say /credits", "say_team /credits",
"say credits", "say_team credits",
"say /points", "say_team /points",
"say /ammopacks", "say_team /ammopacks",
"say ammopacks", "say_team ammopacks"
}
new const g_guns_events[][] = {
"events/awp.sc",
"events/g3sg1.sc",
"events/ak47.sc",
"events/scout.sc",
"events/m249.sc",
"events/m4a1.sc",
"events/sg552.sc",
"events/aug.sc",
"events/sg550.sc",
"events/m3.sc",
"events/xm1014.sc",
"events/usp.sc",
"events/mac10.sc",
"events/ump45.sc",
"events/fiveseven.sc",
"events/p90.sc",
"events/deagle.sc",
"events/p228.sc",
"events/glock18.sc",
"events/mp5n.sc",
"events/tmp.sc",
"events/elite_left.sc",
"events/elite_right.sc",
"events/galil.sc",
"events/famas.sc"
}
new const g_MaxClipAmmo[] =
{
0,
13, //CSW_P228
0,
10, //CSW_SCOUT
0, //CSW_HEGRENADE
7, //CSW_XM1014
0, //CSW_C4
30,//CSW_MAC10
30, //CSW_AUG
0, //CSW_SMOKEGRENADE
15,//CSW_ELITE
20,//CSW_FIVESEVEN
25,//CSW_UMP45
30, //CSW_SG550
35, //CSW_GALIL
25, //CSW_FAMAS
12,//CSW_USP
20,//CSW_GLOCK18
10, //CSW_AWP
30,//CSW_MP5NAVY
100,//CSW_M249
8, //CSW_M3
30, //CSW_M4A1
30,//CSW_TMP
20, //CSW_G3SG1
0, //CSW_FLASHBANG
7, //CSW_DEAGLE
30, //CSW_SG552
30, //CSW_AK47
0, //CSW_KNIFE
50//CSW_P90
}
enum PluginData {
gEnable,
gEnableMoney,
gEnableCredits,
gEnableInfo,
gAntidote,
gHealthKit,
gInfAmmo,
gNoRecoil,
gTAuto,
gCTAuto,
gM249,
gGoldenAK47,
gGoldenAWP,
gGoldenDeagle,
gSuperKnife,
gPALMgranade,
gBOTHgranade,
gFROSTgranade,
gProtection,
gCTShield,
gSpeed,
gGravity,
gArmor
}
enum PluginPrices {
gAntidotePrice,
gHealthKitPrice,
gInfAmmoPrice,
gNoRecoilPrice,
gTAutoPrice,
gCTAutoPrice,
gM249Price,
gGoldenAK47Price,
gGoldenAWPPrice,
gGoldenDeaglePrice,
gSuperKnifePrice,
gPALMgranadePrice,
gFROSTPALMgranadePrice,
gFROSTgranadePrice,
gProtectionPrice,
gCTShieldPrice,
gSpeedPrice,
gGravityPrice,
gArmorPrice
}
enum PluginAmounts {
g_HealthKit_T,
g_HealthKit_CT,
g_Protection,
g_Speed,
g_Gravity
}
/*=======================================================================
-= Íàòèâè =-
========================================================================*/
native bb_is_user_zombie(id)
//--
new const SOPEN[] = "/bbshop/sounds/open.wav"
new const SCLOSE[] = "/bbshop/sounds/close.wav"
new const g_ModelSuperKnife[] = "models/bbshop/models/v_super_knife.mdl";
new const g_ModelGoldenDeagle[] = "models/bbshop/models/v_golden_deagle.mdl";
new const g_ModelGoldenAK47[] = "models/bbshop/models/v_golden_ak47.mdl";
new const g_ModelGoldenAK472[] = "models/bbshop/models/p_golden_ak47.mdl";
new const g_ModelGoldenAWP[] = "models/bbshop/models/v_golden_awp.mdl";
new const g_ModelGoldenAWP2[] = "models/bbshop/models/p_golden_awp.mdl";
new OnOff[ PluginData ], PRICE[ PluginPrices ], Ammount[ PluginAmounts ], UserUses[MAX_PLAYERS][ PluginData ], Points [ MAX_PLAYERS ]
new g_iEnable, g_iEnableMoney, g_iEnableCredits, g_iEnableInfo, g_iAntidote, g_iHealthKit, g_iInfAmmo, g_iNoRecoil,
g_iProtection, g_iSpeed, g_iGravity, g_iTAuto, g_iCTAuto, g_iPALMgranade, g_iFROSTgranade, g_iBOTHgranade, g_iM249, g_iArmor, g_iCTShield,
g_iGoldenAK47, g_iGoldenAWP, g_iGoldenDeagle, g_iSuperKnife
new g_pAntidote, g_pHealthKit, g_pInfAmmo, g_pNoRecoil, g_pProtection, g_pSpeed, g_pGravity, g_pTAuto, g_pCTAuto, g_pPALMgranade, g_pFROSTgranade,
g_pBOTHgranade, g_pM249, g_pArmor, g_pCTShield, g_pGoldenAK47, g_pGoldenAWP, g_pGoldenDeagle, g_pSuperKnife
new g_aHealthKitCT, g_aHealthKitT
new NormalTrace[ MAX_PLAYERS + 1 ], g_guns_eventids_bitsum
new g_fwid
new g_max_clients
new g_iTimer[33]
new gPrefix
new SaveDataFile [ 128 ]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_max_clients = global_get(glb_maxClients)
OnOff[ gEnable ] = register_cvar("bbshop_enable", "1")
OnOff [ gEnableMoney ] = register_cvar("bbshop_money_shop", "1")
OnOff [ gEnableCredits ] = register_cvar("bbshop_credits_shop", "1")
OnOff [ gEnableInfo ] = register_cvar("bbshop_enable_info", "1")
gPrefix = register_cvar("bbshop_prefix", "EXAMPLE")
/*=======================================================================
-= Ìàãàçèí ñ ÊÐÅÄÈÒÈ =-
========================================================================*/
OnOff [ gAntidote ] = register_cvar("bbshop_antidote", "1")
PRICE [ gAntidotePrice ] = register_cvar("bbshop_antidote_price", "20")
OnOff [ gHealthKit ] = register_cvar("bbshop_healtkit", "3")
PRICE [ gHealthKitPrice ] = register_cvar("bbshop_healtkit_price", "30")
Ammount [ g_HealthKit_CT ] = register_cvar("bbshop_healthkit_amm_ct", "50")
Ammount [ g_HealthKit_T ] = register_cvar("bbshop_healthkit_amm_t", "500")
OnOff [ gInfAmmo ] = register_cvar("bbshop_infammo", "1")
PRICE [ gInfAmmoPrice ] = register_cvar("bbshop_infammo_price", "50")
OnOff [ gNoRecoil ] = register_cvar("bbshop_norecoil", "1")
PRICE [ gNoRecoilPrice ] = register_cvar("bbshop_norecoil_price", "40")
OnOff [ gProtection ] = register_cvar("bbshop_protection", "1")
PRICE [ gProtectionPrice ] = register_cvar("bbshop_protection_price", "40")
Ammount [ g_Protection ] = register_cvar("bbshop_proction_ammount", "3")
OnOff [ gSpeed ] = register_cvar("bbshop_speed", "3")
PRICE [ gSpeedPrice ] = register_cvar("bbshop_speed_price", "30")
Ammount [ g_Speed ] = register_cvar("bbshop_speed_ammount", "300.0")
OnOff [ gGravity ] = register_cvar("bbshop_gravity", "3")
PRICE [ gGravityPrice ] = register_cvar("bbshop_gravity_price", "40")
Ammount [ g_Gravity ] = register_cvar("bbshop_gravity_ammount", "0.7")
OnOff [ gGoldenAK47 ] = register_cvar("bbshop_goldenak", "1")
PRICE [ gGoldenAK47Price ] = register_cvar("bbshop_goldenak_price", "40")
OnOff [ gGoldenAWP ] = register_cvar("bbshop_goldenawp", "1")
PRICE [ gGoldenAWPPrice ] = register_cvar("bbshop_goldenawp_price", "30")
OnOff [ gGoldenDeagle ] = register_cvar("bbshop_goldendeagle", "1")
PRICE [ gGoldenDeaglePrice ] = register_cvar("bbshop_goldendeagle_price", "30")
/*=======================================================================
-= Ìàãàçèí ñ ÏÀÐÈ ( $ ) =-
========================================================================*/
OnOff [ gTAuto ] = register_cvar("bbshop_tauto", "1")
PRICE [ gTAutoPrice ] = register_cvar("bbshop_tauto_price", "16000")
OnOff [ gCTAuto ] = register_cvar("bbshop_ctauto", "1")
PRICE [ gCTAutoPrice ] = register_cvar("bbshop_ctauto_price", "16000")
OnOff [ gSuperKnife ] = register_cvar("bbshop_superknife", "1")
PRICE [ gSuperKnifePrice ] = register_cvar("bbshop_superknife_price", "16000")
OnOff [ gPALMgranade ] = register_cvar("bbshop_napalmnade", "1")
PRICE [ gPALMgranadePrice ] = register_cvar("bbshop_napalmnade_price", "6000")
OnOff [ gFROSTgranade ] = register_cvar("bbshop_frostnade", "1")
PRICE [ gFROSTgranadePrice ] = register_cvar("bbshop_frostnade_price", "7000")
OnOff [ gBOTHgranade ] = register_cvar("bbshop_both", "1")
PRICE [ gFROSTPALMgranadePrice ] = register_cvar("bbshop_both_price", "10000")
OnOff [ gM249 ] = register_cvar("bbshop_m249", "1")
PRICE [ gM249Price ] = register_cvar("bbshop_m249_price", "16000")
OnOff [ gCTShield ] = register_cvar("bbshop_ctshield", "1")
PRICE [ gCTShieldPrice ] = register_cvar("bbshop_ctshield_price", "6000")
OnOff [ gArmor ] = register_cvar("bbshop_armor", "1")
PRICE [ gArmorPrice ] = register_cvar("bbshop_armor_price", "5000")
/*============================
ChatCommands
============================*/
for (new i = 0; i < sizeof szChatCommands; i++ )
register_concmd(szChatCommands[i], "HeadShopMenu")
for (new i = 0; i <sizeof szChatCheckCredits; i++)
register_concmd(szChatCheckCredits[i], "CheckCredits")
/*============================
AdminCommands
============================*/
register_concmd( "amx_give_credits", "cmd_give_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_take_credits", "cmd_take_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_give_credits_all", "cmd_give_credits_all", ADMIN_RCON, "<Credits Amount>" );
/*============================
EVENTS/FORWARDS/HAMS
============================*/
unregister_forward(FM_PrecacheEvent, g_fwid, 1)
register_forward(FM_PlayerPreThink, "fwdPlayerPreThink")
register_forward(FM_TraceLine, "fwTraceLine")
RegisterHam(Ham_Spawn, "player", "fwHamSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1);
RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post_KNI", 1);
RegisterHam(Ham_Item_Deploy, "weapon_deagle", "ham_ItemDeploy_Post_DGL", 1);
RegisterHam(Ham_Item_Deploy, "weapon_awp", "ham_ItemDeploy_Post_AWP", 1);
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "ham_ItemDeploy_Post_AK47", 1);
register_event( "CurWeapon", "HookCurWeapon", "be", "1=1" );
register_event ( "DeathMsg", "eDeath", "a" );
/*============================
DATA/SAVING
============================*/
new DataDir [ 64 ];
get_configsdir ( DataDir, charsmax ( DataDir ) );
format ( SaveDataFile, 127, "%s/bbshopcredits.dat", DataDir );
#if USE_CONFIG_FILE == 1
set_task( 1.0, "taskLoadFile" );
#endif
}
public plugin_cfg()
{
g_iEnable = get_pcvar_num(OnOff[ gEnable ])
g_iEnableMoney = get_pcvar_num(OnOff[ gEnableMoney ])
g_iEnableCredits = get_pcvar_num(OnOff[ gEnableCredits ])
g_iEnableInfo = get_pcvar_num(OnOff[ gEnableInfo ])
g_iAntidote = get_pcvar_num(OnOff[ gAntidote ])
g_pAntidote = get_pcvar_num(PRICE[ gAntidotePrice ])
g_iHealthKit = get_pcvar_num(OnOff[ gHealthKit ])
g_pHealthKit = get_pcvar_num(PRICE[ gHealthKitPrice ])
g_aHealthKitCT = get_pcvar_num( Ammount[ g_HealthKit_CT ] )
g_aHealthKitT = get_pcvar_num( Ammount[ g_HealthKit_T ] )
g_iInfAmmo = get_pcvar_num(OnOff[ gInfAmmo ])
g_pInfAmmo = get_pcvar_num(PRICE[ gInfAmmoPrice ])
g_iNoRecoil = get_pcvar_num(OnOff[ gNoRecoil ])
g_pNoRecoil = get_pcvar_num(PRICE[ gNoRecoilPrice ])
g_iProtection = get_pcvar_num(OnOff[ gProtection ])
g_pProtection = get_pcvar_num(PRICE[ gProtectionPrice ])
g_iSpeed = get_pcvar_num(OnOff[ gSpeed ])
g_pSpeed = get_pcvar_num(PRICE[ gSpeedPrice ])
g_iGravity = get_pcvar_num(OnOff[ gGravity ])
g_pGravity = get_pcvar_num(PRICE[ gGravityPrice ])
g_iGoldenAK47 = get_pcvar_num(OnOff[ gGoldenAK47 ])
g_pGoldenAK47 = get_pcvar_num(PRICE[ gGoldenAK47Price ])
g_iGoldenAWP = get_pcvar_num(OnOff[ gGoldenAWP ])
g_pGoldenAWP = get_pcvar_num(PRICE[ gGoldenAWPPrice ])
g_iGoldenDeagle = get_pcvar_num(OnOff[ gGoldenDeagle ])
g_pGoldenDeagle = get_pcvar_num(PRICE[ gGoldenDeaglePrice ])
g_iTAuto = get_pcvar_num(OnOff[ gTAuto ])
g_pTAuto = get_pcvar_num(PRICE[ gTAutoPrice ])
g_iCTAuto = get_pcvar_num(OnOff[ gCTAuto ])
g_pCTAuto = get_pcvar_num(PRICE[ gCTAutoPrice ])
g_iSuperKnife = get_pcvar_num(OnOff[ gSuperKnife ])
g_pSuperKnife = get_pcvar_num(PRICE[ gSuperKnifePrice ])
g_iPALMgranade = get_pcvar_num(OnOff[ gPALMgranade ])
g_pPALMgranade = get_pcvar_num(PRICE[ gPALMgranadePrice ])
g_iFROSTgranade = get_pcvar_num(OnOff[ gFROSTgranade ])
g_pFROSTgranade = get_pcvar_num(PRICE[ gFROSTgranadePrice ])
g_iBOTHgranade = get_pcvar_num(OnOff[ gBOTHgranade ])
g_pBOTHgranade = get_pcvar_num(PRICE[ gFROSTPALMgranadePrice ])
g_iM249 = get_pcvar_num(OnOff[ gM249 ])
g_pM249 = get_pcvar_num(PRICE[ gM249Price ])
g_iCTShield = get_pcvar_num(OnOff[ gCTShield])
g_pCTShield = get_pcvar_num(PRICE[ gCTShieldPrice ])
g_iArmor = get_pcvar_num(OnOff[ gArmor ])
g_pArmor = get_pcvar_num(PRICE[ gArmorPrice ])
}
public HeadShopMenu( id )
{
if(!is_user_alive(id) || g_iEnable == 0)
return
client_cmd(id, "spk %s",SOPEN);
new Title[128]
new money = cs_get_user_money(id)
formatex(Title, 127, "\r[ %s ] \yChoose a currency : \r(\wC\r/\w$\r)^n\wYour Credits : \r%d^n\wYour Money : \r%d", GetPrefix(), Points[ id ], money)
new menu = menu_create(Title, "head_shop_menu_handler")
if(g_iEnableCredits)
{
menu_additem(menu, "\wCredits Shop")
if(g_iEnableInfo == 1)
menu_addtext(menu, "\wIn \r^"Credits Shop^" \wyou can buy only with \rC \y[ \rCredits\y ]", 0)
}
else
menu_additem(menu, "\dCredits Shop \y[\r DISABLED \y]")
if(g_iEnableMoney)
{
menu_additem(menu, "\wMoney Shop")
if(g_iEnableInfo == 1)
menu_addtext(menu, "\wIn \r^"Credits Shop^" \wyou can buy only with \r$ \y[ \rGame Money \y]", 0)
}
else
menu_additem(menu, "\dMoney Shop \y[\r DISABLED \y]")
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public head_shop_menu_handler(id, menu, item)
{
switch ( item )
{
case 0:
{
if(g_iEnableCredits)
{
if(bb_is_user_zombie(id))
{
CreditsShopMenuT( id )
}
else
{
CreditsShopMenuCT( id )
}
}
else
ColorChat(id, RED, "^4[ %s ] ^1Credits Shop is currently ^3DISABLED", GetPrefix())
}
case 1:
{
if(g_iEnableMoney)
{
if(bb_is_user_zombie(id))
{
MoneyShopMenuT( id )
}
else
MoneyShopMenuCT( id )
}
else
ColorChat(id, RED, "^4[ %s ] ^1Money Shop is currently ^3DISABLED", GetPrefix())
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
menu_destroy(menu)
return PLUGIN_HANDLED_MAIN
}
public CreditsShopMenuCT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128], Item7[128], Item8[128], Item9[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128], Item7dis[128], Item8dis[128], Item9dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ %s ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", GetPrefix(), Points[ id ])
formatex(Item1, 127, "\yHealth Kit \r( \w+%d \r) \y[ \r%d \y]", g_aHealthKitCT, g_pHealthKit)
formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item2, 127, "\yInfinity Ammo [\y \r%d \y]", g_pInfAmmo)
formatex(Item2dis, 127, "\dInfinity Ammo \r[ DISABLED ]")
formatex(Item3, 127, "\yNo Recoil [\y \r%d \y]", g_pNoRecoil)
formatex(Item3dis, 127, "\dNo Recoil \r[ DISABLED ]")
formatex(Item4, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item4dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Protection]))
formatex(Item5, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item5dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Speed]))
formatex(Item6, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item6dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
formatex(Item7, 127, "\yGolden AK47 \y[ \r%d \y]", g_pGoldenAK47)
formatex(Item7dis, 127, "\dGolden AK47 \r[ DISABLED ]")
formatex(Item8, 127, "\yGolden AWP \y[ \r%d \y]", g_pGoldenAWP)
formatex(Item8dis, 127, "\dGolden AWP \r[ DISABLED ]")
formatex(Item9, 127, "\yGolden Deagle \y[ \r%d \y]", g_pGoldenDeagle)
formatex(Item9dis, 127, "\dGolden Deagle \r[ DISABLED ]")
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_ct")
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item1dis, "", 1)
case 1: menu_additem(menu, Item1dis, "", 1)
case 2: menu_additem(menu, Item1)
case 3: menu_additem(menu, Item1)
}
if(g_iInfAmmo)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iNoRecoil)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iProtection)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iSpeed)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iGravity)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
if(g_iGoldenAK47)
menu_additem(menu, Item7)
else
menu_additem(menu, Item7dis)
if(g_iGoldenAWP)
menu_additem(menu, Item8)
else
menu_additem(menu, Item8dis)
if(g_iGoldenDeagle)
menu_additem(menu, Item9)
else
menu_additem(menu, Item9dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_ct(id, menu, item)
{
switch( item )
{
case 0:
{
ItemHealthKit(id)
}
case 1:
{
ItemInfAmmo(id)
}
case 2:
{
ItemNoRecoil(id)
}
case 3:
{
ItemProtection(id)
}
case 4:
{
ItemSpeed(id)
}
case 5:
{
ItemGravity(id)
}
case 6:
{
ItemGoldenAK47(id)
}
case 7:
{
ItemGoldenAWP(id)
}
case 8:
{
ItemGoldenDeagle(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public CreditsShopMenuT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128], Item5[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ %s ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", GetPrefix(), Points[ id ])
formatex(Item1, 127, "\yAntidote \y[ \r%d \y]", g_pAntidote)
formatex(Item1dis, 127, "\dAntidote \r[ DISABLED ]")
formatex(Item2, 127, "\yHealth Kit \r( \w+%i \r) \y[ \r%d \y]", g_aHealthKitT, g_pHealthKit)
formatex(Item2dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item3, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item3dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Protection]))
formatex(Item4, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item4dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Speed]))
formatex(Item5, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item5dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_t")
if(g_iAntidote)
menu_additem(menu, Item1)
else
menu_additem(menu, Item1dis)
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item2dis, "", 1)
case 1: menu_additem(menu, Item2)
case 2: menu_additem(menu, Item2dis, "", 1)
case 3: menu_additem(menu, Item2)
}
if(g_iProtection)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iSpeed)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iGravity)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_t(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemAntidote(id)
}
case 1:
{
ItemHealthKit(id)
}
case 2:
{
ItemProtection(id)
}
case 3:
{
ItemSpeed(id)
}
case 4:
{
ItemGravity(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public MoneyShopMenuCT(id)
{
new MoneyTitle[128], money, Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128], Item7[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128], Item7dis[128]
client_cmd(id, "spk %s",SOPEN);
money = cs_get_user_money(id)
formatex(MoneyTitle, 127, "\r[ %s ] \yMoney Shop \r:^n\wYour Money \y: \r%d\y($)", GetPrefix(), money)
formatex(Item1, 127, "\yNapalm Nade \r[ HE ] \y[ \r%d \y]", g_pPALMgranade)
formatex(Item1dis, 127, "\dNapalm Nade [ HE ] \r[ DISABLED ]")
formatex(Item2, 127, "\yFrost Nade \y[ \r%d \y]", g_pFROSTgranade)
formatex(Item2dis, 127, "\dFrost Nade \r[ DISABLED ]")
formatex(Item3, 127, "\yBoth granade ( \wFROST \d+ \rPALM \y) \y[ \r%d \y]", g_pBOTHgranade)
formatex(Item3dis, 127, "\dBoth granade ( FROST + PALM ) \r[ DISABLED ]")
formatex(Item4, 127, "\yT Auto Sniper \y[ \r%d \y]", g_pTAuto)
formatex(Item4dis, 127, "\dT Auto Sniper \r[ DISABLED ]")
formatex(Item5, 127, "\yCT Auto Sniper \y[ \r%d \y]", g_pCTAuto)
formatex(Item5dis, 127, "\dCT Auto Sniper \r[ DISABLED ]")
formatex(Item6, 127, "\yM249 Weapon \y[ \r%d \y]", g_pM249)
formatex(Item6dis, 127, "\dM249 Weapon \r[ DISABLED ]")
formatex(Item7, 127, "\ySuper Knife \y[ \r%d \y]", g_pSuperKnife)
formatex(Item7dis, 127, "\dSuper Knife \r[ DISABLED ]")
new menu = menu_create(MoneyTitle, "money_shop_menu_handler_ct")
if(g_iPALMgranade)
menu_additem(menu, Item1)
else
menu_additem(menu, Item1dis)
if(g_iFROSTgranade)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iBOTHgranade)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iTAuto)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iCTAuto)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iM249)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
if(g_iSuperKnife)
menu_additem(menu, Item7)
else
menu_additem(menu, Item7dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public money_shop_menu_handler_ct(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemPALMgranade(id)
}
case 1:
{
ItemFROSTgranade(id)
}
case 2:
{
ItemBOTHgranade(id)
}
case 3:
{
ItemTAuto(id)
}
case 4:
{
ItemCTAuto(id)
}
case 5:
{
ItemM249(id)
}
case 6:
{
ItemSuperKnife(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
}
public MoneyShopMenuT(id)
{
ColorChat(id, RED, "^4[ %s ] ^1This option will be available soon", GetPrefix())
return PLUGIN_HANDLED
}
public client_connect ( id )
{
NormalTrace[ id ] = 0
LoadPoints ( id )
ResetItems ( id )
}
public client_disconnect ( id )
{
SavePoints ( id )
ResetItems ( id )
}
public fwHamSpawn( id )
{
if(is_user_alive( id ))
ResetItems( id )
}
public CheckCredits(id)
{
ColorChat(id, RED, "^4[ %s ] ^1Imash ^3%i ^1kredita", GetPrefix(), Points[ id ])
}
public eDeath ( )
{
new Killer = read_data ( 1 )
new Victim = read_data ( 2 )
new HeadShoot = read_data ( 3 )
if ( Killer == Victim ) return PLUGIN_HANDLED
Points [ Killer ] += 1
if ( HeadShoot ) {
Points [ Killer ] += 2
}
return PLUGIN_CONTINUE
}
public cmd_give_credits( id, level,cid )
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits;
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
Points[ iTarget ] += iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: give^4 %i^3 credits to^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_take_credits(id, level,cid)
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
if( Points[ iTarget ] < iCredits )
{
console_print(id, "Player %s doesn't even have %d credits! He has: %d credits.", szTargetName, iCredits, Points[ id ]);
return PLUGIN_HANDLED;
}
Points[ id ] -= iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: took^4 %i^3 credits from^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_give_credits_all(id, level, cid)
{
if( !cmd_access( id, level, cid, 2 ) )
return PLUGIN_HANDLED;
new szAmount[32], iCredits
read_argv(1, szAmount, charsmax ( szAmount ) );
new szAdminName[32];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
iCredits= str_to_num( szAmount );
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );
for( new i; i < iNum; i++ )
Points[ i ] = iCredits;
ColorChat( 0,GREY, "^4[%s]^3 ADMIN ^4%s^3: give^4 %i^3 credits to ^4all ^3players", GetPrefix(), szAdminName, iCredits );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public LoadPoints ( id )
{
new Name [ 32 ];
get_user_name ( id, Name, 31 )
new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ]
new File = fopen ( SaveDataFile, "rt" )
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
trim ( Line );
parse ( Line, Arg1, 31, Arg2, 31 )
if ( equali ( Arg1, Name ) ) {
Points [ id ] = str_to_num ( Arg2 )
IsPlayer = true
break;
}
}
fclose ( File );
if ( !IsPlayer )
Points [ id ] = 0;
}
public SavePoints ( id )
{
new Name [ 32 ]
get_user_name ( id, Name, 31 )
new Save [ 1024 ];
format ( Save, sizeof ( Save ) -1, "^"%s^" %d", Name, Points [ id ] )
new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
new File = fopen ( SaveDataFile, "rt" );
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
parse ( Line, Arg1, 31 )
if ( equali ( Arg1, Name ) ) {
write_file ( SaveDataFile, Save, Linie )
IsPlayer = true;
break;
}
Linie++
}
fclose ( File );
if ( !IsPlayer )
write_file ( SaveDataFile, Save, -1 )
}
#if USE_CONFIG_FILE == 1
public taskLoadFile( )
{
new szFile[ 124 ], dir[ 124 ];
get_configsdir( dir, charsmax( dir ) );
formatex( szFile, charsmax ( szFile ), "%s/bbshop.cfg", dir );
if( file_exists( szFile ) )
{
server_cmd( "exec %s", szFile );
server_exec( );
}
else
{
CreateFile( szFile );
log_amx( "bbshop.cfg is not found in configs folder. File is created..." );
}
}
CreateFile( const file[ ] )
{
new i = fopen( file, "wt" );
fprintf( i, "// %s %s by %s^n" , PLUGIN, VERSION, AUTHOR);
fprintf( i, "// Do not modify, If you don't know how!!^n^n" );
fprintf( i, "//ON / OFF CORE SETTINGS^n")
fprintf( i, "//This cvar enable/disable the plugin(Default is 1)^n")
fprintf( i, "bbshop_enable ^"%i^"^n", g_iEnable)
fprintf( i, "//This cvar enable/disable the Money Shop (Default is 1)^n")
fprintf( i, "bbshop_money_shop ^"%i^"^n", g_iEnableMoney)
fprintf( i, "//This cvar enable/disable the Credits Shop (Default is 1)^n")
fprintf( i, "bbshop_credits_shop ^"%i^"^n", g_iEnableCredits)
fprintf( i, "//This cvar enable/disable the all info in chat(after picking an item, core shop menu info) (Default is 1)^n")
fprintf( i, "bbshop_enable_info ^"%i^"^n", g_iEnableInfo)
fprintf( i, "// ITEMS CONFIGURATIONS")
fprintf( i, "// I will sort them by twins first cvar is to enable/disable the item in shop. Secon cvar is the PRICE^n^n")
fprintf( i, "//------------Credits Shop------------^n^n")
fprintf( i, "//Antidote Item^n")
fprintf( i, "bbshop_antidote ^"%i^"", g_iAntidote)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pAntidote)
fprintf( i, "//HealthKit Item^n")
fprintf( i, "//0 Disable | 1 for Terrorist only | 2 for Counter-Terrorist only | 3 for all |^n")
fprintf( i, "bbshop_healthkit ^"%i^"^n", g_iHealthKit)
fprintf( i, "bbshop_healthkit_amm_ct ^"%i^" //Human Bonus HP From SHOP^n", g_aHealthKitCT)
fprintf( i, "bbshop_healthkit_amm_t ^"%i^" //Zombie Bonus HP From SHOP^n", g_aHealthKitT)
fprintf( i, "bbshop_healthkit_price ^"%i^"^n^n", g_pHealthKit)
fprintf( i, "//Infinity Ammo Item^n")
fprintf( i, "bbshop_infammo ^"%i^"^n", g_iInfAmmo)
fprintf( i, "bbshop_infammo_price ^"%i^"^n^n", g_pInfAmmo)
fprintf( i, "//No Recoil Item^n")
fprintf( i, "bbshop_norecoil ^"%i^"^n", g_iNoRecoil)
fprintf( i, "bbshop_norecoil_price ^"%i^"^n^n", g_pNoRecoil)
fprintf( i, "//Protection Item (GodMode)^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iProtection)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pProtection)
fprintf( i, "//Gravity Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iGravity)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pGravity)
fprintf( i, "//Speed Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iSpeed)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pSpeed)
fprintf( i, "//Golden AK47 Item^n")
fprintf( i, "bbshop_goldenak ^"%i^"^n", g_iGoldenAK47)
fprintf( i, "bbshop_goldenak_price ^"%i^"^n^n", g_pGoldenAK47)
fprintf( i, "//Golden Deagle Item^n")
fprintf( i, "bbshop_goldendeagle ^"%i^"^n", g_iGoldenDeagle)
fprintf( i, "bbshop_goldendeagle_price ^"%i^"^n^n", g_pGoldenDeagle)
fprintf( i, "//Golden AWP Item^n")
fprintf( i, "bbshop_goldenawp ^"%i^"^n", g_iGoldenAWP)
fprintf( i, "bbshop_goldenawp_price ^"%i^"^n^n", g_pGoldenAWP)
fprintf( i, "//------------MONEY SHOP ( $ ) -------------^n^n")
fprintf( i, "//T Auto Item^n")
fprintf( i, "bbshop_tauto ^"%i^"^n", g_iTAuto)
fprintf( i, "bbshop_tauto_price ^"%i^"^n^n", g_pTAuto)
fprintf( i, "//CT Auto Item^n")
fprintf( i, "bbshop_ctauto ^"%i^"^n", g_iCTAuto)
fprintf( i, "bbshop_ctauto_price ^"%i^"^n^n", g_pCTAuto)
fprintf( i, "//Super Knife Item^n")
fprintf( i, "bbshop_superknife ^"%i^"^n", g_iSuperKnife)
fprintf( i, "bbshop_superknife_price ^"%i^"^n^n", g_pSuperKnife)
fprintf( i, "//PALM NADE Item (Include the PALM NADE Plugin or it will be just a HE granade)^n")
fprintf( i, "bbshop_napalmnade ^"%i^"^n", g_iPALMgranade)
fprintf( i, "bbshop_napalmnade_price ^"%i^"^n^n", g_pPALMgranade)
fprintf( i, "//FROSTNADE Item (Include the Frost Nade Plugin or it will be just a SMOKENADE)^n")
fprintf( i, "bbshop_frostnade ^"%i^"^n", g_iFROSTgranade)
fprintf( i, "bbshop_frostnade_price ^"%i^"^n^n", g_pFROSTgranade)
fprintf( i, "//Both Granades ( PALM + FROST ) Item^n")
fprintf( i, "bbshop_both ^"%i^"^n", g_iBOTHgranade)
fprintf( i, "bbshop_both_price ^"%i^"^n^n", g_pBOTHgranade)
fprintf( i, "//M249 Item^n")
fprintf( i, "bbshop_m249 ^"%i^"^n", g_iM249)
fprintf( i, "bbshop_m249_price ^"%i^"^n^n", g_pM249)
fprintf( i, "//CT Shield Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iCTShield)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pCTShield)
fprintf( i, "//Armor Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iArmor)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pArmor)
fprintf( i, "SPECIAL THANKS TO : AJW/1337")
fclose( i );
}
#endif
public plugin_precache()
{
precache_sound(SOPEN)
precache_sound(SCLOSE)
precache_model(g_ModelGoldenDeagle)
precache_model(g_ModelGoldenAWP)
precache_model(g_ModelGoldenAWP2)
precache_model(g_ModelGoldenAK47)
precache_model(g_ModelGoldenAK472)
precache_model(g_ModelSuperKnife)
g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1)
}
public ResetItems(id)
{
UserUses[ id ][ gAntidote ] = false
UserUses[ id ][ gHealthKit ] = false
UserUses[ id ][ gInfAmmo ] = false
UserUses[ id ][ gNoRecoil ] = false
UserUses[ id ][ gTAuto ] = false
UserUses[ id ][ gCTAuto ] = false
UserUses[ id ][ gPALMgranade ] = false
UserUses[ id ][ gBOTHgranade ] = false
UserUses[ id ][ gM249 ] = false
UserUses[ id ][ gFROSTgranade ] = false
UserUses[ id ][ gProtection ] = false
UserUses[ id ][ gCTShield ] = false
UserUses[ id ][ gSpeed ] = false
UserUses[ id ][ gGravity ] = false
UserUses[ id ][ gArmor ] = false
UserUses[ id ][ gSuperKnife ] = false
UserUses[ id ][ gGoldenAK47 ] = false
UserUses[ id ][ gGoldenAWP ] = false
UserUses[ id ][ gGoldenDeagle ] = false
}
public fwPrecacheEvent(type, const name[]) {
for (new i = 0; i < sizeof g_guns_events; ++i) {
if (equal(g_guns_events[i], name)) {
g_guns_eventids_bitsum |= (1<<get_orig_retval())
return FMRES_HANDLED
}
}
return FMRES_IGNORED
}
public fwdPlayerPreThink( id )
{
new iWeapon = get_user_weapon( id );
if ( !pev_valid( id ) )
return FMRES_IGNORED;
if ( iWeapon == CSW_AWP || iWeapon == CSW_KNIFE || iWeapon == CSW_C4 || iWeapon == CSW_HEGRENADE || iWeapon == CSW_FLASHBANG || iWeapon == CSW_SMOKEGRENADE )
return FMRES_IGNORED;
if ( UserUses[ id ][ gNoRecoil ] )
{
set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0})
}
return FMRES_IGNORED;
}
public fwTraceLine(const Float:start[3], const Float:dest[3], ignore_monsters, id, ptr) {
if (!(1 <= id <= g_max_clients))
return FMRES_IGNORED
if (!NormalTrace[id]) {
NormalTrace[id] = ptr
return FMRES_HANDLED
}
static dummy
if (ptr == NormalTrace[id] || ignore_monsters != DONT_IGNORE_MONSTERS || !is_user_alive(id) || get_user_weapon(id, dummy, dummy) == CSW_KNIFE)
return FMRES_IGNORED
fix_recoil_trace(id, start, ptr)
return FMRES_SUPERCEDE
}
public taskProtectionTimer(id)
{
//OCIXCROM
id-=TASK
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Remaining seconds %i---", g_iTimer[ id ])
// Íàìàëÿâàø òàéìåðà çà 1 ñåêóíäà è àêî å äîñòèãíàë 0, ïðåìàõâàø task-à.
if(--g_iTimer[id] == 0)
{
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Protection ENDED---")
set_user_godmode(id, 0)
remove_task(id+TASK)
}
//END
}
public ItemAntidote(id)
{
if(is_user_alive(id) && bb_is_user_zombie(id))
{
if(g_iAntidote == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gAntidote ])
{
alreadyhave(id)
}
if(Points[ id ] < g_pAntidote)
{
notenough(id)
return PLUGIN_HANDLED
}
cs_set_user_team(id, CS_TEAM_CT, 7)
set_user_health(id, 100)
Points[ id ] -= g_pAntidote
UserUses[ id ][ gAntidote ] = true
if ( callfunc_begin("show_method_menu", "basebuilder65.amxx") == 1 )
{
callfunc_push_int( id )
callfunc_end( )
}
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Antidote aplied^nYou are now a HUMAN" )
}
return PLUGIN_HANDLED
}
public ItemHealthKit(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iHealthKit== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gHealthKit ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pHealthKit)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pHealthKit
UserUses[ id ][ gHealthKit ] = true
new aHealth
switch ( get_user_team(id) )
{
case 1: aHealth = get_pcvar_num(Ammount[ g_HealthKit_T])
case 2: aHealth = get_pcvar_num(Ammount[ g_HealthKit_CT])
}
set_user_health( id, get_user_health(id) + aHealth);
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully added (%d) to your health", aHealth)
}
return PLUGIN_HANDLED
}
public ItemProtection(id)
{
if(is_user_alive(id))
{
if(g_iProtection== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gProtection ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pProtection)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_godmode(id, 1)
g_iTimer[ id ] = get_pcvar_num(Ammount[ g_Protection ])
set_task(0.5, "taskProtectionTimer", id+TASK, _,_,"b")
UserUses[ id ][ gProtection ] = true
Points[ id ] -= g_pProtection
}
return PLUGIN_HANDLED
}
public ItemSpeed(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSpeed == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSpeed ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pSpeed)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_maxspeed(id , get_pcvar_float(Ammount [ g_Speed ]))
Points[ id ] -= g_pSpeed
UserUses[ id ][ gSpeed ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your speed has been increased to %i !", get_pcvar_num(Ammount[g_Speed]))
set_user_maxspeed(id, get_pcvar_float( Ammount[ g_Speed ] ))
}
return PLUGIN_HANDLED
}
public ItemGravity(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGravity == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGravity ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGravity)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_gravity(id, get_pcvar_float(Ammount[ g_Gravity ]))
Points[ id ] -= g_pGravity
UserUses[ id ][ gGravity ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your gravity has been decreased to %d", get_user_gravity(id))
}
return PLUGIN_HANDLED
}
public ItemNoRecoil(id)
{
//new szRandom = random(256)
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(g_iNoRecoil == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gNoRecoil ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pNoRecoil)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pNoRecoil
UserUses[ id ][ gNoRecoil ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "No Recoil on all weapons is now active" )
//set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 });
return PLUGIN_HANDLED
}
public ItemInfAmmo(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iInfAmmo == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gInfAmmo ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pInfAmmo)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pInfAmmo
UserUses[ id ][ gInfAmmo ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Unlimited Clip is now active")
}
return PLUGIN_HANDLED
}
public ItemTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pTAuto)
UserUses[ id ][ gTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought T Auto ( G3SG1 )")
give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 200);
}
return PLUGIN_HANDLED
}
public ItemCTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iCTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gCTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pCTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pCTAuto)
UserUses[ id ][ gCTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought CT Auto ( SG550 )")
give_item(id, "weapon_sg550")
cs_set_user_bpammo(id, CSW_SG550, 200);
}
return PLUGIN_HANDLED
}
public ItemM249(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iM249 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gM249 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pM249)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pM249)
UserUses[ id ][ gM249 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a M249 Carbine")
give_item(id, "weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 200);
}
return PLUGIN_HANDLED
}
public ItemPALMgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iPALMgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gPALMgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pPALMgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pPALMgranade)
UserUses[ id ][ gPALMgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a PALM Granade")
give_item(id, "weapon_hegranade")
}
return PLUGIN_HANDLED
}
public ItemFROSTgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iFROSTgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gFROSTgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pFROSTgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pFROSTgranade)
UserUses[ id ][ gFROSTgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a Frost Granade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemBOTHgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iBOTHgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gBOTHgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pBOTHgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pBOTHgranade)
UserUses[ id ][ gBOTHgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Both Granades ( PALM + FROST )")
give_item(id, "weapon_hegranade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemSuperKnife(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSuperKnife == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSuperKnife ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pSuperKnife)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pSuperKnife)
UserUses[ id ][ gSuperKnife ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Super Knife")
}
return PLUGIN_HANDLED
}
public ItemGoldenDeagle(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenDeagle == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenDeagle ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenDeagle)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenDeagle
UserUses[ id ][ gGoldenDeagle ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
strip_user_weapons(id);
give_item( id, "weapon_knife" )
show_dhudmessage( id, "You successfully bought Golden DEAGLE")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAK47(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAK47 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAK47 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAK47)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAK47
UserUses[ id ][ gGoldenAK47 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden AK47")
strip_user_weapons(id);
give_item( id, "weapon_knife" )
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAWP(id)
{
////new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAWP == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAWP ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAWP)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAWP
UserUses[ id ][ gGoldenAWP ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden AWP")
strip_user_weapons(id);
give_item( id, "weapon_knife" )
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 200);
}
return PLUGIN_HANDLED
}
public ham_ItemDeploy_Post_KNI(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && UserUses[owner][ gSuperKnife ])
{
set_pev(owner, pev_viewmodel2, g_ModelSuperKnife);
}
}
public ham_ItemDeploy_Post_DGL(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenDeagle ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenDeagle);
}
}
public ham_ItemDeploy_Post_AK47(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAK47 ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAK47);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAK472))
}
}
public ham_ItemDeploy_Post_AWP(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAWP ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAWP);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAWP2))
}
}
public Player_ResetMaxSpeed(id)
{
if( is_user_alive(id) && get_user_maxspeed(id) != -1.0 && UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount[ g_Speed ]));
}
}
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
if( !IsPlayer1( attacker ) || !is_user_alive( attacker ) || inflictor != attacker )
{
return;
}
if ( UserUses[attacker][ gSuperKnife ] && get_user_weapon(attacker) == CSW_KNIFE )
{
SetHamParamFloat( 4, damage * 231 );
}
if ( UserUses[attacker][ gGoldenAWP ] && get_user_weapon(attacker) == CSW_AWP )
{
SetHamParamFloat( 4, damage * 2 );
}
if ( UserUses[attacker][ gGoldenDeagle] && get_user_weapon(attacker) == CSW_DEAGLE )
{
SetHamParamFloat( 4, damage * 4 );
}
if ( UserUses[attacker][ gGoldenAK47 ] && ( get_user_weapon(attacker) == CSW_AK47) )
{
SetHamParamFloat( 4, damage * 2 );
}
}
public HookCurWeapon( id )
{
/* --| If plugin is on, and user has speed item, let's set the speed again */
if( g_iEnable != 0)
{
new iWeapon = read_data(2)
if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) && UserUses[ id ][ gInfAmmo ] )
{
fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] )
}
if(UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount [ g_Speed ]))
}
}
}
public alreadyhave(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You already own this item", GetPrefix())
}
public notenough(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You ^3don't ^1have enough credits/money to buy this item", GetPrefix())
}
stock ResetMaxspeed( id )
{
static Float:fMaxSpeed;
ExecuteHamB( Ham_CS_Item_GetMaxSpeed, get_pdata_cbase( id, m_pActiveItem ), fMaxSpeed );
entity_set_float( id, EV_FL_maxspeed, fMaxSpeed );
}
stock GetPrefix()
{
new Prefix[33]
get_pcvar_string(gPrefix, Prefix, charsmax(Prefix))
return Prefix
}
stock get_user_money(id, Ammount)
{
new money = cs_get_user_money(id)
cs_set_user_money(id, money - Ammount, 1)
return money
}
fix_recoil_trace(id, const Float:start[], ptr) {
static Float:dest[3]
pev(id, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
}
-
sf4n
Извън линия - Потребител
- Мнения: 311
- Регистриран на: 08 Яну 2018, 11:25
- Се отблагодари: 25 пъти
- Получена благодарност: 14 пъти
Решение на няколко проблема в BB 6.5?
Извинете ме, но забравих да добавя, че този plugin го променях бая, а ето кода, който аз ползвам. Ако може тук да го добавите. Ако не сте ме разбрали правилно, идеята ми е, че когато закупя goldak остават 2те оръжия горе в падащото меню, а не, че се хвърля на земята и тем подобни.
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <fakemeta>
#include <engine>
#include <xs>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif
#define TASK 222333
#define m_pActiveItem 373
#define PLUGIN "Zombie BB Shop For 6.5 TIRANT"
#define VERSION "1.0"
#define AUTHOR "Just In Case"
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
#define IsPlayer1(%1) ( 1 <= %1 <= MAX_PLAYERS )
//CONFIG FILE
#define USE_CONFIG_FILE 1
// weapons offsets
#define OFFSET_CLIPAMMO 51
#define OFFSET_LINUX_WEAPONS 4
#define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new const szChatCommands[][] = {
"say /shop", "say_team /shop",
"say shop", "say_team shop",
"say /market", "say_team /market",
"say market", "say_team market"
}
new const szChatCheckCredits[][] = {
"say /credits", "say_team /credits",
"say credits", "say_team credits",
"say /points", "say_team /points",
"say /ammopacks", "say_team /ammopacks",
"say ammopacks", "say_team ammopacks"
}
new const g_guns_events[][] = {
"events/awp.sc",
"events/g3sg1.sc",
"events/ak47.sc",
"events/scout.sc",
"events/m249.sc",
"events/m4a1.sc",
"events/sg552.sc",
"events/aug.sc",
"events/sg550.sc",
"events/m3.sc",
"events/xm1014.sc",
"events/usp.sc",
"events/mac10.sc",
"events/ump45.sc",
"events/fiveseven.sc",
"events/p90.sc",
"events/deagle.sc",
"events/p228.sc",
"events/glock18.sc",
"events/mp5n.sc",
"events/tmp.sc",
"events/elite_left.sc",
"events/elite_right.sc",
"events/galil.sc",
"events/famas.sc"
}
new const g_MaxClipAmmo[] =
{
0,
13, //CSW_P228
0,
10, //CSW_SCOUT
0, //CSW_HEGRENADE
7, //CSW_XM1014
0, //CSW_C4
30,//CSW_MAC10
30, //CSW_AUG
0, //CSW_SMOKEGRENADE
15,//CSW_ELITE
20,//CSW_FIVESEVEN
25,//CSW_UMP45
30, //CSW_SG550
35, //CSW_GALIL
25, //CSW_FAMAS
12,//CSW_USP
20,//CSW_GLOCK18
10, //CSW_AWP
30,//CSW_MP5NAVY
100,//CSW_M249
8, //CSW_M3
30, //CSW_M4A1
30,//CSW_TMP
20, //CSW_G3SG1
0, //CSW_FLASHBANG
7, //CSW_DEAGLE
30, //CSW_SG552
30, //CSW_AK47
0, //CSW_KNIFE
50//CSW_P90
}
enum PluginData {
gEnable,
gEnableMoney,
gEnableCredits,
gEnableInfo,
gAntidote,
gHealthKit,
gInfAmmo,
gNoRecoil,
gTAuto,
gCTAuto,
gM249,
gGoldenAK47,
gGoldenAWP,
gGoldenDeagle,
gSuperKnife,
gPALMgranade,
gBOTHgranade,
gFROSTgranade,
gProtection,
gCTShield,
gSpeed,
gGravity,
gArmor
}
enum PluginPrices {
gAntidotePrice,
gHealthKitPrice,
gInfAmmoPrice,
gNoRecoilPrice,
gTAutoPrice,
gCTAutoPrice,
gM249Price,
gGoldenAK47Price,
gGoldenAWPPrice,
gGoldenDeaglePrice,
gSuperKnifePrice,
gPALMgranadePrice,
gFROSTPALMgranadePrice,
gFROSTgranadePrice,
gProtectionPrice,
gCTShieldPrice,
gSpeedPrice,
gGravityPrice,
gArmorPrice
}
enum PluginAmounts {
g_HealthKit_T,
g_HealthKit_CT,
g_Protection,
g_Speed,
g_Gravity
}
/*=======================================================================
-= Нативи =-
========================================================================*/
native bb_is_user_zombie(id)
//--
new const SOPEN[] = "/bbshop/sounds/open.wav"
new const SCLOSE[] = "/bbshop/sounds/close.wav"
new const g_ModelSuperKnife[] = "models/bbshop/models/v_super_knife.mdl";
new const g_ModelGoldenDeagle[] = "models/bbshop/models/v_golden_deagle.mdl";
new const g_ModelGoldenAK47[] = "models/bbshop/models/v_golden_ak47.mdl";
new const g_ModelGoldenAK472[] = "models/bbshop/models/p_golden_ak47.mdl";
new const g_ModelGoldenAWP[] = "models/bbshop/models/v_golden_awp.mdl";
new const g_ModelGoldenAWP2[] = "models/bbshop/models/p_golden_awp.mdl";
new OnOff[ PluginData ], PRICE[ PluginPrices ], Ammount[ PluginAmounts ], UserUses[MAX_PLAYERS][ PluginData ], Points [ MAX_PLAYERS ]
new g_iEnable, g_iEnableMoney, g_iEnableCredits, g_iEnableInfo, g_iAntidote, g_iHealthKit, g_iInfAmmo, g_iNoRecoil,
g_iProtection, g_iSpeed, g_iGravity, g_iTAuto, g_iCTAuto, g_iPALMgranade, g_iFROSTgranade, g_iBOTHgranade, g_iM249, g_iArmor, g_iCTShield,
g_iGoldenAK47, g_iGoldenAWP, g_iGoldenDeagle, g_iSuperKnife
new g_pAntidote, g_pHealthKit, g_pInfAmmo, g_pNoRecoil, g_pProtection, g_pSpeed, g_pGravity, g_pTAuto, g_pCTAuto, g_pPALMgranade, g_pFROSTgranade,
g_pBOTHgranade, g_pM249, g_pArmor, g_pCTShield, g_pGoldenAK47, g_pGoldenAWP, g_pGoldenDeagle, g_pSuperKnife
new g_aHealthKitCT, g_aHealthKitT
new NormalTrace[ MAX_PLAYERS + 1 ], g_guns_eventids_bitsum
new g_fwid
new g_max_clients
new g_iTimer[33]
new gPrefix
new SaveDataFile [ 128 ]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_max_clients = global_get(glb_maxClients)
OnOff[ gEnable ] = register_cvar("bbshop_enable", "1")
OnOff [ gEnableMoney ] = register_cvar("bbshop_money_shop", "0")
OnOff [ gEnableCredits ] = register_cvar("bbshop_credits_shop", "1")
OnOff [ gEnableInfo ] = register_cvar("bbshop_enable_info", "1")
gPrefix = register_cvar("bbshop_prefix", "CS-ZAPAD")
/*=======================================================================
-= Магазин с КРЕДИТИ =-
========================================================================*/
OnOff [ gAntidote ] = register_cvar("bbshop_antidote", "0")
PRICE [ gAntidotePrice ] = register_cvar("bbshop_antidote_price", "20")
OnOff [ gHealthKit ] = register_cvar("bbshop_healtkit", "3")
PRICE [ gHealthKitPrice ] = register_cvar("bbshop_healtkit_price", "30")
Ammount [ g_HealthKit_CT ] = register_cvar("bbshop_healthkit_amm_ct", "50")
Ammount [ g_HealthKit_T ] = register_cvar("bbshop_healthkit_amm_t", "1000")
OnOff [ gInfAmmo ] = register_cvar("bbshop_infammo", "0")
PRICE [ gInfAmmoPrice ] = register_cvar("bbshop_infammo_price", "50")
OnOff [ gNoRecoil ] = register_cvar("bbshop_norecoil", "2")
PRICE [ gNoRecoilPrice ] = register_cvar("bbshop_norecoil_price", "40")
OnOff [ gProtection ] = register_cvar("bbshop_protection", "3")
PRICE [ gProtectionPrice ] = register_cvar("bbshop_protection_price", "40")
Ammount [ g_Protection ] = register_cvar("bbshop_proction_ammount", "3")
OnOff [ gSpeed ] = register_cvar("bbshop_speed", "3")
PRICE [ gSpeedPrice ] = register_cvar("bbshop_speed_price", "30")
Ammount [ g_Speed ] = register_cvar("bbshop_speed_ammount", "300.0")
OnOff [ gGravity ] = register_cvar("bbshop_gravity", "3")
PRICE [ gGravityPrice ] = register_cvar("bbshop_gravity_price", "40")
Ammount [ g_Gravity ] = register_cvar("bbshop_gravity_ammount", "0.7")
OnOff [ gGoldenAK47 ] = register_cvar("bbshop_goldenak", "1")
PRICE [ gGoldenAK47Price ] = register_cvar("bbshop_goldenak_price", "40")
OnOff [ gGoldenAWP ] = register_cvar("bbshop_goldenawp", "0")
PRICE [ gGoldenAWPPrice ] = register_cvar("bbshop_goldenawp_price", "30")
OnOff [ gGoldenDeagle ] = register_cvar("bbshop_goldendeagle", "0")
PRICE [ gGoldenDeaglePrice ] = register_cvar("bbshop_goldendeagle_price", "30")
/*=======================================================================
-= Магазин с ПАРИ ( $ ) =-
========================================================================*/
OnOff [ gTAuto ] = register_cvar("bbshop_tauto", "1")
PRICE [ gTAutoPrice ] = register_cvar("bbshop_tauto_price", "16000")
OnOff [ gCTAuto ] = register_cvar("bbshop_ctauto", "1")
PRICE [ gCTAutoPrice ] = register_cvar("bbshop_ctauto_price", "16000")
OnOff [ gSuperKnife ] = register_cvar("bbshop_superknife", "1")
PRICE [ gSuperKnifePrice ] = register_cvar("bbshop_superknife_price", "16000")
OnOff [ gPALMgranade ] = register_cvar("bbshop_napalmnade", "1")
PRICE [ gPALMgranadePrice ] = register_cvar("bbshop_napalmnade_price", "6000")
OnOff [ gFROSTgranade ] = register_cvar("bbshop_frostnade", "1")
PRICE [ gFROSTgranadePrice ] = register_cvar("bbshop_frostnade_price", "7000")
OnOff [ gBOTHgranade ] = register_cvar("bbshop_both", "1")
PRICE [ gFROSTPALMgranadePrice ] = register_cvar("bbshop_both_price", "10000")
OnOff [ gM249 ] = register_cvar("bbshop_m249", "1")
PRICE [ gM249Price ] = register_cvar("bbshop_m249_price", "16000")
OnOff [ gCTShield ] = register_cvar("bbshop_ctshield", "1")
PRICE [ gCTShieldPrice ] = register_cvar("bbshop_ctshield_price", "6000")
OnOff [ gArmor ] = register_cvar("bbshop_armor", "1")
PRICE [ gArmorPrice ] = register_cvar("bbshop_armor_price", "5000")
/*============================
ChatCommands
============================*/
for (new i = 0; i < sizeof szChatCommands; i++ )
register_concmd(szChatCommands[i], "HeadShopMenu")
for (new i = 0; i <sizeof szChatCheckCredits; i++)
register_concmd(szChatCheckCredits[i], "CheckCredits")
/*============================
AdminCommands
============================*/
register_concmd( "amx_give_credits", "cmd_give_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_take_credits", "cmd_take_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_give_credits_all", "cmd_give_credits_all", ADMIN_RCON, "<Credits Amount>" );
/*============================
EVENTS/FORWARDS/HAMS
============================*/
unregister_forward(FM_PrecacheEvent, g_fwid, 1)
register_forward(FM_PlayerPreThink, "fwdPlayerPreThink")
register_forward(FM_TraceLine, "fwTraceLine")
RegisterHam(Ham_Spawn, "player", "fwHamSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1);
RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post_KNI", 1);
RegisterHam(Ham_Item_Deploy, "weapon_deagle", "ham_ItemDeploy_Post_DGL", 1);
RegisterHam(Ham_Item_Deploy, "weapon_awp", "ham_ItemDeploy_Post_AWP", 1);
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "ham_ItemDeploy_Post_AK47", 1);
register_event( "CurWeapon", "HookCurWeapon", "be", "1=1" );
register_event ( "DeathMsg", "eDeath", "a" );
/*============================
DATA/SAVING
============================*/
new DataDir [ 64 ];
get_configsdir ( DataDir, charsmax ( DataDir ) );
format ( SaveDataFile, 127, "%s/bbshopcredits.dat", DataDir );
#if USE_CONFIG_FILE == 1
set_task( 1.0, "taskLoadFile" );
#endif
}
public plugin_cfg()
{
g_iEnable = get_pcvar_num(OnOff[ gEnable ])
g_iEnableMoney = get_pcvar_num(OnOff[ gEnableMoney ])
g_iEnableCredits = get_pcvar_num(OnOff[ gEnableCredits ])
g_iEnableInfo = get_pcvar_num(OnOff[ gEnableInfo ])
g_iAntidote = get_pcvar_num(OnOff[ gAntidote ])
g_pAntidote = get_pcvar_num(PRICE[ gAntidotePrice ])
g_iHealthKit = get_pcvar_num(OnOff[ gHealthKit ])
g_pHealthKit = get_pcvar_num(PRICE[ gHealthKitPrice ])
g_aHealthKitCT = get_pcvar_num( Ammount[ g_HealthKit_CT ] )
g_aHealthKitT = get_pcvar_num( Ammount[ g_HealthKit_T ] )
g_iInfAmmo = get_pcvar_num(OnOff[ gInfAmmo ])
g_pInfAmmo = get_pcvar_num(PRICE[ gInfAmmoPrice ])
g_iNoRecoil = get_pcvar_num(OnOff[ gNoRecoil ])
g_pNoRecoil = get_pcvar_num(PRICE[ gNoRecoilPrice ])
g_iProtection = get_pcvar_num(OnOff[ gProtection ])
g_pProtection = get_pcvar_num(PRICE[ gProtectionPrice ])
g_iSpeed = get_pcvar_num(OnOff[ gSpeed ])
g_pSpeed = get_pcvar_num(PRICE[ gSpeedPrice ])
g_iGravity = get_pcvar_num(OnOff[ gGravity ])
g_pGravity = get_pcvar_num(PRICE[ gGravityPrice ])
g_iGoldenAK47 = get_pcvar_num(OnOff[ gGoldenAK47 ])
g_pGoldenAK47 = get_pcvar_num(PRICE[ gGoldenAK47Price ])
g_iGoldenAWP = get_pcvar_num(OnOff[ gGoldenAWP ])
g_pGoldenAWP = get_pcvar_num(PRICE[ gGoldenAWPPrice ])
g_iGoldenDeagle = get_pcvar_num(OnOff[ gGoldenDeagle ])
g_pGoldenDeagle = get_pcvar_num(PRICE[ gGoldenDeaglePrice ])
g_iTAuto = get_pcvar_num(OnOff[ gTAuto ])
g_pTAuto = get_pcvar_num(PRICE[ gTAutoPrice ])
g_iCTAuto = get_pcvar_num(OnOff[ gCTAuto ])
g_pCTAuto = get_pcvar_num(PRICE[ gCTAutoPrice ])
g_iSuperKnife = get_pcvar_num(OnOff[ gSuperKnife ])
g_pSuperKnife = get_pcvar_num(PRICE[ gSuperKnifePrice ])
g_iPALMgranade = get_pcvar_num(OnOff[ gPALMgranade ])
g_pPALMgranade = get_pcvar_num(PRICE[ gPALMgranadePrice ])
g_iFROSTgranade = get_pcvar_num(OnOff[ gFROSTgranade ])
g_pFROSTgranade = get_pcvar_num(PRICE[ gFROSTgranadePrice ])
g_iBOTHgranade = get_pcvar_num(OnOff[ gBOTHgranade ])
g_pBOTHgranade = get_pcvar_num(PRICE[ gFROSTPALMgranadePrice ])
g_iM249 = get_pcvar_num(OnOff[ gM249 ])
g_pM249 = get_pcvar_num(PRICE[ gM249Price ])
g_iCTShield = get_pcvar_num(OnOff[ gCTShield])
g_pCTShield = get_pcvar_num(PRICE[ gCTShieldPrice ])
g_iArmor = get_pcvar_num(OnOff[ gArmor ])
g_pArmor = get_pcvar_num(PRICE[ gArmorPrice ])
}
public HeadShopMenu( id )
{
if(!is_user_alive(id) || g_iEnable == 0)
return
if(bb_is_user_zombie(id))
{
CreditsShopMenuT( id )
}
else
{
CreditsShopMenuCT( id )
}
}
public head_shop_menu_handler(id, menu, item)
{
switch ( item )
{
case 0:
{
if(g_iEnableCredits)
{
if(bb_is_user_zombie(id))
{
CreditsShopMenuT( id )
}
else
{
CreditsShopMenuCT( id )
}
}
else
ColorChat(id, RED, "^4[ %s ] ^1Credits Shop is currently ^3DISABLED", GetPrefix())
}
case 1:
{
if(g_iEnableMoney)
{
if(bb_is_user_zombie(id))
{
MoneyShopMenuT( id )
}
else
MoneyShopMenuCT( id )
}
else
ColorChat(id, RED, "^4[ %s ] ^1Money Shop is currently ^3DISABLED", GetPrefix())
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
menu_destroy(menu)
return PLUGIN_HANDLED_MAIN
}
public CreditsShopMenuCT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ])
formatex(Item1, 127, "\yHealth Kit \r( \w+%d \r) \y[ \r%d \y]", g_aHealthKitCT, g_pHealthKit)
formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item2, 127, "\yNo Recoil [\y \r%d \y]", g_pNoRecoil)
formatex(Item2dis, 127, "\dNo Recoil \r[ DISABLED ]")
formatex(Item3, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item3dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Protection]))
formatex(Item4, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item4dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Speed]))
formatex(Item5, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item5dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
formatex(Item6, 127, "\yGolden AK47 \y[ \r%d \y]", g_pGoldenAK47)
formatex(Item6dis, 127, "\dGolden AK47 \r[ DISABLED ]")
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_ct")
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item1dis, "", 1)
case 1: menu_additem(menu, Item1dis, "", 1)
case 2: menu_additem(menu, Item1)
case 3: menu_additem(menu, Item1)
}
if(g_iNoRecoil)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iProtection)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iSpeed)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iGravity)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iGoldenAK47)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_ct(id, menu, item)
{
switch( item )
{
case 0:
{
ItemHealthKit(id)
}
case 1:
{
ItemNoRecoil(id)
}
case 2:
{
ItemProtection(id)
}
case 3:
{
ItemSpeed(id)
}
case 4:
{
ItemGravity(id)
}
case 5:
{
ItemGoldenAK47(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public CreditsShopMenuT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ])
formatex(Item1, 127, "\yHealth Kit \r( \w+%i \r) \y[ \r%d \y]", g_aHealthKitT, g_pHealthKit)
formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item2, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item2dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Protection]))
formatex(Item3, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item3dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Speed]))
formatex(Item4, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item4dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_t")
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item1dis, "", 1)
case 1: menu_additem(menu, Item1)
case 2: menu_additem(menu, Item1dis, "", 1)
case 3: menu_additem(menu, Item1)
}
if(g_iProtection)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iSpeed)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iGravity)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_t(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemHealthKit(id)
}
case 1:
{
ItemProtection(id)
}
case 2:
{
ItemSpeed(id)
}
case 3:
{
ItemGravity(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public MoneyShopMenuCT(id)
{
new MoneyTitle[128], money, Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128], Item7[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128], Item7dis[128]
client_cmd(id, "spk %s",SOPEN);
money = cs_get_user_money(id)
formatex(MoneyTitle, 127, "\r[ %s ] \yMoney Shop \r:^n\wYour Money \y: \r%d\y($)", GetPrefix(), money)
formatex(Item1, 127, "\yNapalm Nade \r[ HE ] \y[ \r%d \y]", g_pPALMgranade)
formatex(Item1dis, 127, "\dNapalm Nade [ HE ] \r[ DISABLED ]")
formatex(Item2, 127, "\yFrost Nade \y[ \r%d \y]", g_pFROSTgranade)
formatex(Item2dis, 127, "\dFrost Nade \r[ DISABLED ]")
formatex(Item3, 127, "\yBoth granade ( \wFROST \d+ \rPALM \y) \y[ \r%d \y]", g_pBOTHgranade)
formatex(Item3dis, 127, "\dBoth granade ( FROST + PALM ) \r[ DISABLED ]")
formatex(Item4, 127, "\yT Auto Sniper \y[ \r%d \y]", g_pTAuto)
formatex(Item4dis, 127, "\dT Auto Sniper \r[ DISABLED ]")
formatex(Item5, 127, "\yCT Auto Sniper \y[ \r%d \y]", g_pCTAuto)
formatex(Item5dis, 127, "\dCT Auto Sniper \r[ DISABLED ]")
formatex(Item6, 127, "\yM249 Weapon \y[ \r%d \y]", g_pM249)
formatex(Item6dis, 127, "\dM249 Weapon \r[ DISABLED ]")
formatex(Item7, 127, "\ySuper Knife \y[ \r%d \y]", g_pSuperKnife)
formatex(Item7dis, 127, "\dSuper Knife \r[ DISABLED ]")
new menu = menu_create(MoneyTitle, "money_shop_menu_handler_ct")
if(g_iPALMgranade)
menu_additem(menu, Item1)
else
menu_additem(menu, Item1dis)
if(g_iFROSTgranade)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iBOTHgranade)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iTAuto)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iCTAuto)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iM249)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
if(g_iSuperKnife)
menu_additem(menu, Item7)
else
menu_additem(menu, Item7dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public money_shop_menu_handler_ct(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemPALMgranade(id)
}
case 1:
{
ItemFROSTgranade(id)
}
case 2:
{
ItemBOTHgranade(id)
}
case 3:
{
ItemTAuto(id)
}
case 4:
{
ItemCTAuto(id)
}
case 5:
{
ItemM249(id)
}
case 6:
{
ItemSuperKnife(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
}
public MoneyShopMenuT(id)
{
ColorChat(id, RED, "^4[ %s ] ^1This option will be available soon", GetPrefix())
return PLUGIN_HANDLED
}
public client_connect ( id )
{
NormalTrace[ id ] = 0
LoadPoints ( id )
ResetItems ( id )
}
public client_disconnect ( id )
{
SavePoints ( id )
ResetItems ( id )
}
public fwHamSpawn( id )
{
if(is_user_alive( id ))
ResetItems( id )
}
public CheckCredits(id)
{
ColorChat(id, RED, "^4[ %s ] ^1Imash ^3%i ^1kredita", GetPrefix(), Points[ id ])
}
public eDeath ( )
{
new Killer = read_data ( 1 )
new Victim = read_data ( 2 )
new HeadShoot = read_data ( 3 )
if ( Killer == Victim ) return PLUGIN_HANDLED
if ( HeadShoot )
{
if(!bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi s^x04 headshot^x01 i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 4^x04 credita");
Points [ Killer ] += 4
}
else if(bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human s^x04 headshot^x01 i poluchavate 4^x04 credita");
Points [ Killer ] += 4
}
}
else if ( !HeadShoot )
{
if(bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human i poluchavate 2^x04 credita");
Points [ Killer ] += 2
}
else if(!bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 2^x04 credita");
Points [ Killer ] += 2
}
}
return PLUGIN_CONTINUE
}
public cmd_give_credits( id, level,cid )
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits;
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
Points[ iTarget ] += iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: give^4 %i^3 credits to^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_take_credits(id, level,cid)
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
if( Points[ iTarget ] < iCredits )
{
console_print(id, "Player %s doesn't even have %d credits! He has: %d credits.", szTargetName, iCredits, Points[ id ]);
return PLUGIN_HANDLED;
}
Points[ id ] -= iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: took^4 %i^3 credits from^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_give_credits_all(id, level, cid)
{
if( !cmd_access( id, level, cid, 2 ) )
return PLUGIN_HANDLED;
new szAmount[32], iCredits
read_argv(1, szAmount, charsmax ( szAmount ) );
new szAdminName[32];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
iCredits= str_to_num( szAmount );
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );
for( new i; i < iNum; i++ )
Points[ i ] = iCredits;
ColorChat( 0,GREY, "^4[%s]^3 ADMIN ^4%s^3: give^4 %i^3 credits to ^4all ^3players", GetPrefix(), szAdminName, iCredits );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public LoadPoints ( id )
{
new Name [ 32 ];
get_user_name ( id, Name, 31 )
new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ]
new File = fopen ( SaveDataFile, "rt" )
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
trim ( Line );
parse ( Line, Arg1, 31, Arg2, 31 )
if ( equali ( Arg1, Name ) ) {
Points [ id ] = str_to_num ( Arg2 )
IsPlayer = true
break;
}
}
fclose ( File );
if ( !IsPlayer )
Points [ id ] = 0;
}
public SavePoints ( id )
{
new Name [ 32 ]
get_user_name ( id, Name, 31 )
new Save [ 1024 ];
format ( Save, sizeof ( Save ) -1, "^"%s^" %d", Name, Points [ id ] )
new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
new File = fopen ( SaveDataFile, "rt" );
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
parse ( Line, Arg1, 31 )
if ( equali ( Arg1, Name ) ) {
write_file ( SaveDataFile, Save, Linie )
IsPlayer = true;
break;
}
Linie++
}
fclose ( File );
if ( !IsPlayer )
write_file ( SaveDataFile, Save, -1 )
}
#if USE_CONFIG_FILE == 1
public taskLoadFile( )
{
new szFile[ 124 ], dir[ 124 ];
get_configsdir( dir, charsmax( dir ) );
formatex( szFile, charsmax ( szFile ), "%s/bbshop.cfg", dir );
if( file_exists( szFile ) )
{
server_cmd( "exec %s", szFile );
server_exec( );
}
else
{
CreateFile( szFile );
log_amx( "bbshop.cfg is not found in configs folder. File is created..." );
}
}
CreateFile( const file[ ] )
{
new i = fopen( file, "wt" );
fprintf( i, "// %s %s by %s^n" , PLUGIN, VERSION, AUTHOR);
fprintf( i, "// Do not modify, If you don't know how!!^n^n" );
fprintf( i, "//ON / OFF CORE SETTINGS^n")
fprintf( i, "//This cvar enable/disable the plugin(Default is 1)^n")
fprintf( i, "bbshop_enable ^"%i^"^n", g_iEnable)
fprintf( i, "//This cvar enable/disable the Money Shop (Default is 1)^n")
fprintf( i, "bbshop_money_shop ^"%i^"^n", g_iEnableMoney)
fprintf( i, "//This cvar enable/disable the Credits Shop (Default is 1)^n")
fprintf( i, "bbshop_credits_shop ^"%i^"^n", g_iEnableCredits)
fprintf( i, "//This cvar enable/disable the all info in chat(after picking an item, core shop menu info) (Default is 1)^n")
fprintf( i, "bbshop_enable_info ^"%i^"^n", g_iEnableInfo)
fprintf( i, "// ITEMS CONFIGURATIONS")
fprintf( i, "// I will sort them by twins first cvar is to enable/disable the item in shop. Secon cvar is the PRICE^n^n")
fprintf( i, "//------------Credits Shop------------^n^n")
fprintf( i, "//Antidote Item^n")
fprintf( i, "bbshop_antidote ^"%i^"", g_iAntidote)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pAntidote)
fprintf( i, "//HealthKit Item^n")
fprintf( i, "//0 Disable | 1 for Terrorist only | 2 for Counter-Terrorist only | 3 for all |^n")
fprintf( i, "bbshop_healthkit ^"%i^"^n", g_iHealthKit)
fprintf( i, "bbshop_healthkit_amm_ct ^"%i^" //Human Bonus HP From SHOP^n", g_aHealthKitCT)
fprintf( i, "bbshop_healthkit_amm_t ^"%i^" //Zombie Bonus HP From SHOP^n", g_aHealthKitT)
fprintf( i, "bbshop_healthkit_price ^"%i^"^n^n", g_pHealthKit)
fprintf( i, "//Infinity Ammo Item^n")
fprintf( i, "bbshop_infammo ^"%i^"^n", g_iInfAmmo)
fprintf( i, "bbshop_infammo_price ^"%i^"^n^n", g_pInfAmmo)
fprintf( i, "//No Recoil Item^n")
fprintf( i, "bbshop_norecoil ^"%i^"^n", g_iNoRecoil)
fprintf( i, "bbshop_norecoil_price ^"%i^"^n^n", g_pNoRecoil)
fprintf( i, "//Protection Item (GodMode)^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iProtection)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pProtection)
fprintf( i, "//Gravity Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iGravity)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pGravity)
fprintf( i, "//Speed Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iSpeed)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pSpeed)
fprintf( i, "//Golden AK47 Item^n")
fprintf( i, "bbshop_goldenak ^"%i^"^n", g_iGoldenAK47)
fprintf( i, "bbshop_goldenak_price ^"%i^"^n^n", g_pGoldenAK47)
fprintf( i, "//Golden Deagle Item^n")
fprintf( i, "bbshop_goldendeagle ^"%i^"^n", g_iGoldenDeagle)
fprintf( i, "bbshop_goldendeagle_price ^"%i^"^n^n", g_pGoldenDeagle)
fprintf( i, "//Golden AWP Item^n")
fprintf( i, "bbshop_goldenawp ^"%i^"^n", g_iGoldenAWP)
fprintf( i, "bbshop_goldenawp_price ^"%i^"^n^n", g_pGoldenAWP)
fprintf( i, "//------------MONEY SHOP ( $ ) -------------^n^n")
fprintf( i, "//T Auto Item^n")
fprintf( i, "bbshop_tauto ^"%i^"^n", g_iTAuto)
fprintf( i, "bbshop_tauto_price ^"%i^"^n^n", g_pTAuto)
fprintf( i, "//CT Auto Item^n")
fprintf( i, "bbshop_ctauto ^"%i^"^n", g_iCTAuto)
fprintf( i, "bbshop_ctauto_price ^"%i^"^n^n", g_pCTAuto)
fprintf( i, "//Super Knife Item^n")
fprintf( i, "bbshop_superknife ^"%i^"^n", g_iSuperKnife)
fprintf( i, "bbshop_superknife_price ^"%i^"^n^n", g_pSuperKnife)
fprintf( i, "//PALM NADE Item (Include the PALM NADE Plugin or it will be just a HE granade)^n")
fprintf( i, "bbshop_napalmnade ^"%i^"^n", g_iPALMgranade)
fprintf( i, "bbshop_napalmnade_price ^"%i^"^n^n", g_pPALMgranade)
fprintf( i, "//FROSTNADE Item (Include the Frost Nade Plugin or it will be just a SMOKENADE)^n")
fprintf( i, "bbshop_frostnade ^"%i^"^n", g_iFROSTgranade)
fprintf( i, "bbshop_frostnade_price ^"%i^"^n^n", g_pFROSTgranade)
fprintf( i, "//Both Granades ( PALM + FROST ) Item^n")
fprintf( i, "bbshop_both ^"%i^"^n", g_iBOTHgranade)
fprintf( i, "bbshop_both_price ^"%i^"^n^n", g_pBOTHgranade)
fprintf( i, "//M249 Item^n")
fprintf( i, "bbshop_m249 ^"%i^"^n", g_iM249)
fprintf( i, "bbshop_m249_price ^"%i^"^n^n", g_pM249)
fprintf( i, "//CT Shield Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iCTShield)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pCTShield)
fprintf( i, "//Armor Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iArmor)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pArmor)
fprintf( i, "SPECIAL THANKS TO : AJW/1337")
fclose( i );
}
#endif
public plugin_precache()
{
precache_sound(SOPEN)
precache_sound(SCLOSE)
precache_model(g_ModelGoldenDeagle)
precache_model(g_ModelGoldenAWP)
precache_model(g_ModelGoldenAWP2)
precache_model(g_ModelGoldenAK47)
precache_model(g_ModelGoldenAK472)
precache_model(g_ModelSuperKnife)
g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1)
}
public ResetItems(id)
{
UserUses[ id ][ gAntidote ] = false
UserUses[ id ][ gHealthKit ] = false
UserUses[ id ][ gInfAmmo ] = false
UserUses[ id ][ gNoRecoil ] = false
UserUses[ id ][ gTAuto ] = false
UserUses[ id ][ gCTAuto ] = false
UserUses[ id ][ gPALMgranade ] = false
UserUses[ id ][ gBOTHgranade ] = false
UserUses[ id ][ gM249 ] = false
UserUses[ id ][ gFROSTgranade ] = false
UserUses[ id ][ gProtection ] = false
UserUses[ id ][ gCTShield ] = false
UserUses[ id ][ gSpeed ] = false
UserUses[ id ][ gGravity ] = false
UserUses[ id ][ gArmor ] = false
UserUses[ id ][ gSuperKnife ] = false
UserUses[ id ][ gGoldenAK47 ] = false
UserUses[ id ][ gGoldenAWP ] = false
UserUses[ id ][ gGoldenDeagle ] = false
}
public fwPrecacheEvent(type, const name[]) {
for (new i = 0; i < sizeof g_guns_events; ++i) {
if (equal(g_guns_events[i], name)) {
g_guns_eventids_bitsum |= (1<<get_orig_retval())
return FMRES_HANDLED
}
}
return FMRES_IGNORED
}
public fwdPlayerPreThink( id )
{
new iWeapon = get_user_weapon( id );
if ( !pev_valid( id ) )
return FMRES_IGNORED;
if ( iWeapon == CSW_AWP || iWeapon == CSW_KNIFE || iWeapon == CSW_C4 || iWeapon == CSW_HEGRENADE || iWeapon == CSW_FLASHBANG || iWeapon == CSW_SMOKEGRENADE )
return FMRES_IGNORED;
if ( UserUses[ id ][ gNoRecoil ] )
{
set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0})
}
return FMRES_IGNORED;
}
public fwTraceLine(const Float:start[3], const Float:dest[3], ignore_monsters, id, ptr) {
if (!(1 <= id <= g_max_clients))
return FMRES_IGNORED
if (!NormalTrace[id]) {
NormalTrace[id] = ptr
return FMRES_HANDLED
}
static dummy
if (ptr == NormalTrace[id] || ignore_monsters != DONT_IGNORE_MONSTERS || !is_user_alive(id) || get_user_weapon(id, dummy, dummy) == CSW_KNIFE)
return FMRES_IGNORED
fix_recoil_trace(id, start, ptr)
return FMRES_SUPERCEDE
}
public taskProtectionTimer(id)
{
//OCIXCROM
id-=TASK
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Remaining seconds %i---", g_iTimer[ id ])
// Намаляваш таймера за 1 секунда и ако е достигнал 0, премахваш task-а.
if(--g_iTimer[id] == 0)
{
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Protection ENDED---")
set_user_godmode(id, 0)
remove_task(id+TASK)
}
//END
}
public ItemAntidote(id)
{
if(is_user_alive(id) && bb_is_user_zombie(id))
{
if(g_iAntidote == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gAntidote ])
{
alreadyhave(id)
}
if(Points[ id ] < g_pAntidote)
{
notenough(id)
return PLUGIN_HANDLED
}
cs_set_user_team(id, CS_TEAM_CT, 7)
set_user_health(id, 100)
Points[ id ] -= g_pAntidote
UserUses[ id ][ gAntidote ] = true
if ( callfunc_begin("show_method_menu", "basebuilder65.amxx") == 1 )
{
callfunc_push_int( id )
callfunc_end( )
}
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Antidote aplied^nYou are now a HUMAN" )
}
return PLUGIN_HANDLED
}
public ItemHealthKit(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iHealthKit== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gHealthKit ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pHealthKit)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pHealthKit
UserUses[ id ][ gHealthKit ] = true
new aHealth
switch ( get_user_team(id) )
{
case 1: aHealth = get_pcvar_num(Ammount[ g_HealthKit_T])
case 2: aHealth = get_pcvar_num(Ammount[ g_HealthKit_CT])
}
set_user_health( id, get_user_health(id) + aHealth);
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully added (%d) to your health", aHealth)
}
return PLUGIN_HANDLED
}
public ItemProtection(id)
{
if(is_user_alive(id))
{
if(g_iProtection== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gProtection ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pProtection)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_godmode(id, 1)
g_iTimer[ id ] = get_pcvar_num(Ammount[ g_Protection ])
set_task(0.5, "taskProtectionTimer", id+TASK, _,_,"b")
UserUses[ id ][ gProtection ] = true
Points[ id ] -= g_pProtection
}
return PLUGIN_HANDLED
}
public ItemSpeed(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSpeed == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSpeed ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pSpeed)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_maxspeed(id , get_pcvar_float(Ammount [ g_Speed ]))
Points[ id ] -= g_pSpeed
UserUses[ id ][ gSpeed ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your speed has been increased to %i !", get_pcvar_num(Ammount[g_Speed]))
set_user_maxspeed(id, get_pcvar_float( Ammount[ g_Speed ] ))
}
return PLUGIN_HANDLED
}
public ItemGravity(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGravity == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGravity ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGravity)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_gravity(id, get_pcvar_float(Ammount[ g_Gravity ]))
Points[ id ] -= g_pGravity
UserUses[ id ][ gGravity ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your gravity has been decreased to %d", get_user_gravity(id))
}
return PLUGIN_HANDLED
}
public ItemNoRecoil(id)
{
//new szRandom = random(256)
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(g_iNoRecoil == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gNoRecoil ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pNoRecoil)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pNoRecoil
UserUses[ id ][ gNoRecoil ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "No Recoil on all weapons is now active" )
//set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 });
return PLUGIN_HANDLED
}
public ItemInfAmmo(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iInfAmmo == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gInfAmmo ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pInfAmmo)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pInfAmmo
UserUses[ id ][ gInfAmmo ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Unlimited Clip is now active")
}
return PLUGIN_HANDLED
}
public ItemTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pTAuto)
UserUses[ id ][ gTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought T Auto ( G3SG1 )")
give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 200);
}
return PLUGIN_HANDLED
}
public ItemCTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iCTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gCTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pCTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pCTAuto)
UserUses[ id ][ gCTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought CT Auto ( SG550 )")
give_item(id, "weapon_sg550")
cs_set_user_bpammo(id, CSW_SG550, 200);
}
return PLUGIN_HANDLED
}
public ItemM249(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iM249 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gM249 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pM249)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pM249)
UserUses[ id ][ gM249 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a M249 Carbine")
give_item(id, "weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 200);
}
return PLUGIN_HANDLED
}
public ItemPALMgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iPALMgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gPALMgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pPALMgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pPALMgranade)
UserUses[ id ][ gPALMgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a PALM Granade")
give_item(id, "weapon_hegranade")
}
return PLUGIN_HANDLED
}
public ItemFROSTgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iFROSTgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gFROSTgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pFROSTgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pFROSTgranade)
UserUses[ id ][ gFROSTgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a Frost Granade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemBOTHgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iBOTHgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gBOTHgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pBOTHgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pBOTHgranade)
UserUses[ id ][ gBOTHgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Both Granades ( PALM + FROST )")
give_item(id, "weapon_hegranade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemSuperKnife(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSuperKnife == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSuperKnife ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pSuperKnife)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pSuperKnife)
UserUses[ id ][ gSuperKnife ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Super Knife")
}
return PLUGIN_HANDLED
}
public ItemGoldenDeagle(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenDeagle == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenDeagle ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenDeagle)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenDeagle
UserUses[ id ][ gGoldenDeagle ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden DEAGLE")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAK47(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAK47 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAK47 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAK47)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAK47
UserUses[ id ][ gGoldenAK47 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden AK47")
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAWP(id)
{
////new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAWP == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAWP ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAWP)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAWP
UserUses[ id ][ gGoldenAWP ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden AWP")
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 200);
}
return PLUGIN_HANDLED
}
public ham_ItemDeploy_Post_KNI(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && UserUses[owner][ gSuperKnife ])
{
set_pev(owner, pev_viewmodel2, g_ModelSuperKnife);
}
}
public ham_ItemDeploy_Post_DGL(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenDeagle ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenDeagle);
}
}
public ham_ItemDeploy_Post_AK47(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAK47 ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAK47);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAK472))
}
}
public ham_ItemDeploy_Post_AWP(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAWP ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAWP);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAWP2))
}
}
public Player_ResetMaxSpeed(id)
{
if( is_user_alive(id) && get_user_maxspeed(id) != -1.0 && UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount[ g_Speed ]));
}
}
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
if( !IsPlayer1( attacker ) || !is_user_alive( attacker ) || inflictor != attacker )
{
return;
}
if ( UserUses[attacker][ gSuperKnife ] && get_user_weapon(attacker) == CSW_KNIFE )
{
SetHamParamFloat( 4, damage * 231 );
}
if ( UserUses[attacker][ gGoldenAWP ] && get_user_weapon(attacker) == CSW_AWP )
{
SetHamParamFloat( 4, damage * 2 );
}
if ( UserUses[attacker][ gGoldenDeagle] && get_user_weapon(attacker) == CSW_DEAGLE )
{
SetHamParamFloat( 4, damage * 4 );
}
if ( UserUses[attacker][ gGoldenAK47 ] && ( get_user_weapon(attacker) == CSW_AK47) )
{
SetHamParamFloat( 4, damage * 1.10 );
}
}
public HookCurWeapon( id )
{
/* --| If plugin is on, and user has speed item, let's set the speed again */
if( g_iEnable != 0)
{
new iWeapon = read_data(2)
if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) && UserUses[ id ][ gInfAmmo ] )
{
fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] )
}
if(UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount [ g_Speed ]))
}
}
}
public alreadyhave(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You already own this item", GetPrefix())
}
public notenough(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You ^3don't ^1have enough credits/money to buy this item", GetPrefix())
}
stock ResetMaxspeed( id )
{
static Float:fMaxSpeed;
ExecuteHamB( Ham_CS_Item_GetMaxSpeed, get_pdata_cbase( id, m_pActiveItem ), fMaxSpeed );
entity_set_float( id, EV_FL_maxspeed, fMaxSpeed );
}
stock GetPrefix()
{
new Prefix[33]
get_pcvar_string(gPrefix, Prefix, charsmax(Prefix))
return Prefix
}
stock get_user_money(id, Ammount)
{
new money = cs_get_user_money(id)
cs_set_user_money(id, money - Ammount, 1)
return money
}
fix_recoil_trace(id, const Float:start[], ptr) {
static Float:dest[3]
pev(id, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
}
Единствен по рода си Zombie BaseBuilder с уникален мод и коректни админи по всяко време в сървъра.
IP: bb.cs-zapad.eu:27013
Respawn сървър.
IP: re.cs-zapad.eu:27015
Furien сървър.
IP: fu.cs-zapad.eu:27016
Нашият Сайт
Нашият Форум
-
illusion
Извън линия - Developer
- Мнения: 1810
- Регистриран на: 27 Ное 2016, 17:47
- Местоположение: CraftVision
- Се отблагодари: 151 пъти
- Получена благодарност: 370 пъти
- Обратна връзка:
Решение на няколко проблема в BB 6.5?
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <fakemeta>
#include <engine>
#include <xs>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif
#define TASK 222333
#define m_pActiveItem 373
#define PLUGIN "Zombie BB Shop For 6.5 TIRANT"
#define VERSION "1.0"
#define AUTHOR "Just In Case"
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
#define IsPlayer1(%1) ( 1 <= %1 <= MAX_PLAYERS )
//CONFIG FILE
#define USE_CONFIG_FILE 1
// weapons offsets
#define OFFSET_CLIPAMMO 51
#define OFFSET_LINUX_WEAPONS 4
#define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new const szChatCommands[][] = {
"say /shop", "say_team /shop",
"say shop", "say_team shop",
"say /market", "say_team /market",
"say market", "say_team market"
}
new const szChatCheckCredits[][] = {
"say /credits", "say_team /credits",
"say credits", "say_team credits",
"say /points", "say_team /points",
"say /ammopacks", "say_team /ammopacks",
"say ammopacks", "say_team ammopacks"
}
new const g_guns_events[][] = {
"events/awp.sc",
"events/g3sg1.sc",
"events/ak47.sc",
"events/scout.sc",
"events/m249.sc",
"events/m4a1.sc",
"events/sg552.sc",
"events/aug.sc",
"events/sg550.sc",
"events/m3.sc",
"events/xm1014.sc",
"events/usp.sc",
"events/mac10.sc",
"events/ump45.sc",
"events/fiveseven.sc",
"events/p90.sc",
"events/deagle.sc",
"events/p228.sc",
"events/glock18.sc",
"events/mp5n.sc",
"events/tmp.sc",
"events/elite_left.sc",
"events/elite_right.sc",
"events/galil.sc",
"events/famas.sc"
}
new const g_MaxClipAmmo[] =
{
0,
13, //CSW_P228
0,
10, //CSW_SCOUT
0, //CSW_HEGRENADE
7, //CSW_XM1014
0, //CSW_C4
30,//CSW_MAC10
30, //CSW_AUG
0, //CSW_SMOKEGRENADE
15,//CSW_ELITE
20,//CSW_FIVESEVEN
25,//CSW_UMP45
30, //CSW_SG550
35, //CSW_GALIL
25, //CSW_FAMAS
12,//CSW_USP
20,//CSW_GLOCK18
10, //CSW_AWP
30,//CSW_MP5NAVY
100,//CSW_M249
8, //CSW_M3
30, //CSW_M4A1
30,//CSW_TMP
20, //CSW_G3SG1
0, //CSW_FLASHBANG
7, //CSW_DEAGLE
30, //CSW_SG552
30, //CSW_AK47
0, //CSW_KNIFE
50//CSW_P90
}
enum PluginData {
gEnable,
gEnableMoney,
gEnableCredits,
gEnableInfo,
gAntidote,
gHealthKit,
gInfAmmo,
gNoRecoil,
gTAuto,
gCTAuto,
gM249,
gGoldenAK47,
gGoldenAWP,
gGoldenDeagle,
gSuperKnife,
gPALMgranade,
gBOTHgranade,
gFROSTgranade,
gProtection,
gCTShield,
gSpeed,
gGravity,
gArmor
}
enum PluginPrices {
gAntidotePrice,
gHealthKitPrice,
gInfAmmoPrice,
gNoRecoilPrice,
gTAutoPrice,
gCTAutoPrice,
gM249Price,
gGoldenAK47Price,
gGoldenAWPPrice,
gGoldenDeaglePrice,
gSuperKnifePrice,
gPALMgranadePrice,
gFROSTPALMgranadePrice,
gFROSTgranadePrice,
gProtectionPrice,
gCTShieldPrice,
gSpeedPrice,
gGravityPrice,
gArmorPrice
}
enum PluginAmounts {
g_HealthKit_T,
g_HealthKit_CT,
g_Protection,
g_Speed,
g_Gravity
}
/*=======================================================================
-= Нативи =-
========================================================================*/
native bb_is_user_zombie(id)
//--
new const SOPEN[] = "/bbshop/sounds/open.wav"
new const SCLOSE[] = "/bbshop/sounds/close.wav"
new const g_ModelSuperKnife[] = "models/bbshop/models/v_super_knife.mdl";
new const g_ModelGoldenDeagle[] = "models/bbshop/models/v_golden_deagle.mdl";
new const g_ModelGoldenAK47[] = "models/bbshop/models/v_golden_ak47.mdl";
new const g_ModelGoldenAK472[] = "models/bbshop/models/p_golden_ak47.mdl";
new const g_ModelGoldenAWP[] = "models/bbshop/models/v_golden_awp.mdl";
new const g_ModelGoldenAWP2[] = "models/bbshop/models/p_golden_awp.mdl";
new OnOff[ PluginData ], PRICE[ PluginPrices ], Ammount[ PluginAmounts ], UserUses[MAX_PLAYERS][ PluginData ], Points [ MAX_PLAYERS ]
new g_iEnable, g_iEnableMoney, g_iEnableCredits, g_iEnableInfo, g_iAntidote, g_iHealthKit, g_iInfAmmo, g_iNoRecoil,
g_iProtection, g_iSpeed, g_iGravity, g_iTAuto, g_iCTAuto, g_iPALMgranade, g_iFROSTgranade, g_iBOTHgranade, g_iM249, g_iArmor, g_iCTShield,
g_iGoldenAK47, g_iGoldenAWP, g_iGoldenDeagle, g_iSuperKnife
new g_pAntidote, g_pHealthKit, g_pInfAmmo, g_pNoRecoil, g_pProtection, g_pSpeed, g_pGravity, g_pTAuto, g_pCTAuto, g_pPALMgranade, g_pFROSTgranade,
g_pBOTHgranade, g_pM249, g_pArmor, g_pCTShield, g_pGoldenAK47, g_pGoldenAWP, g_pGoldenDeagle, g_pSuperKnife
new g_aHealthKitCT, g_aHealthKitT
new NormalTrace[ MAX_PLAYERS + 1 ], g_guns_eventids_bitsum
new g_fwid
new g_max_clients
new g_iTimer[33]
new gPrefix
new SaveDataFile [ 128 ]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_max_clients = global_get(glb_maxClients)
OnOff[ gEnable ] = register_cvar("bbshop_enable", "1")
OnOff [ gEnableMoney ] = register_cvar("bbshop_money_shop", "0")
OnOff [ gEnableCredits ] = register_cvar("bbshop_credits_shop", "1")
OnOff [ gEnableInfo ] = register_cvar("bbshop_enable_info", "1")
gPrefix = register_cvar("bbshop_prefix", "CS-ZAPAD")
/*=======================================================================
-= Магазин с КРЕДИТИ =-
========================================================================*/
OnOff [ gAntidote ] = register_cvar("bbshop_antidote", "0")
PRICE [ gAntidotePrice ] = register_cvar("bbshop_antidote_price", "20")
OnOff [ gHealthKit ] = register_cvar("bbshop_healtkit", "3")
PRICE [ gHealthKitPrice ] = register_cvar("bbshop_healtkit_price", "30")
Ammount [ g_HealthKit_CT ] = register_cvar("bbshop_healthkit_amm_ct", "50")
Ammount [ g_HealthKit_T ] = register_cvar("bbshop_healthkit_amm_t", "1000")
OnOff [ gInfAmmo ] = register_cvar("bbshop_infammo", "0")
PRICE [ gInfAmmoPrice ] = register_cvar("bbshop_infammo_price", "50")
OnOff [ gNoRecoil ] = register_cvar("bbshop_norecoil", "2")
PRICE [ gNoRecoilPrice ] = register_cvar("bbshop_norecoil_price", "40")
OnOff [ gProtection ] = register_cvar("bbshop_protection", "3")
PRICE [ gProtectionPrice ] = register_cvar("bbshop_protection_price", "40")
Ammount [ g_Protection ] = register_cvar("bbshop_proction_ammount", "3")
OnOff [ gSpeed ] = register_cvar("bbshop_speed", "3")
PRICE [ gSpeedPrice ] = register_cvar("bbshop_speed_price", "30")
Ammount [ g_Speed ] = register_cvar("bbshop_speed_ammount", "300.0")
OnOff [ gGravity ] = register_cvar("bbshop_gravity", "3")
PRICE [ gGravityPrice ] = register_cvar("bbshop_gravity_price", "40")
Ammount [ g_Gravity ] = register_cvar("bbshop_gravity_ammount", "0.7")
OnOff [ gGoldenAK47 ] = register_cvar("bbshop_goldenak", "1")
PRICE [ gGoldenAK47Price ] = register_cvar("bbshop_goldenak_price", "40")
OnOff [ gGoldenAWP ] = register_cvar("bbshop_goldenawp", "0")
PRICE [ gGoldenAWPPrice ] = register_cvar("bbshop_goldenawp_price", "30")
OnOff [ gGoldenDeagle ] = register_cvar("bbshop_goldendeagle", "0")
PRICE [ gGoldenDeaglePrice ] = register_cvar("bbshop_goldendeagle_price", "30")
/*=======================================================================
-= Магазин с ПАРИ ( $ ) =-
========================================================================*/
OnOff [ gTAuto ] = register_cvar("bbshop_tauto", "1")
PRICE [ gTAutoPrice ] = register_cvar("bbshop_tauto_price", "16000")
OnOff [ gCTAuto ] = register_cvar("bbshop_ctauto", "1")
PRICE [ gCTAutoPrice ] = register_cvar("bbshop_ctauto_price", "16000")
OnOff [ gSuperKnife ] = register_cvar("bbshop_superknife", "1")
PRICE [ gSuperKnifePrice ] = register_cvar("bbshop_superknife_price", "16000")
OnOff [ gPALMgranade ] = register_cvar("bbshop_napalmnade", "1")
PRICE [ gPALMgranadePrice ] = register_cvar("bbshop_napalmnade_price", "6000")
OnOff [ gFROSTgranade ] = register_cvar("bbshop_frostnade", "1")
PRICE [ gFROSTgranadePrice ] = register_cvar("bbshop_frostnade_price", "7000")
OnOff [ gBOTHgranade ] = register_cvar("bbshop_both", "1")
PRICE [ gFROSTPALMgranadePrice ] = register_cvar("bbshop_both_price", "10000")
OnOff [ gM249 ] = register_cvar("bbshop_m249", "1")
PRICE [ gM249Price ] = register_cvar("bbshop_m249_price", "16000")
OnOff [ gCTShield ] = register_cvar("bbshop_ctshield", "1")
PRICE [ gCTShieldPrice ] = register_cvar("bbshop_ctshield_price", "6000")
OnOff [ gArmor ] = register_cvar("bbshop_armor", "1")
PRICE [ gArmorPrice ] = register_cvar("bbshop_armor_price", "5000")
/*============================
ChatCommands
============================*/
for (new i = 0; i < sizeof szChatCommands; i++ )
register_concmd(szChatCommands[i], "HeadShopMenu")
for (new i = 0; i <sizeof szChatCheckCredits; i++)
register_concmd(szChatCheckCredits[i], "CheckCredits")
/*============================
AdminCommands
============================*/
register_concmd( "amx_give_credits", "cmd_give_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_take_credits", "cmd_take_credits", ADMIN_RCON, "<name> <Credits Amount>" );
register_concmd( "amx_give_credits_all", "cmd_give_credits_all", ADMIN_RCON, "<Credits Amount>" );
/*============================
EVENTS/FORWARDS/HAMS
============================*/
unregister_forward(FM_PrecacheEvent, g_fwid, 1)
register_forward(FM_PlayerPreThink, "fwdPlayerPreThink")
register_forward(FM_TraceLine, "fwTraceLine")
RegisterHam(Ham_Spawn, "player", "fwHamSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1);
RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post_KNI", 1);
RegisterHam(Ham_Item_Deploy, "weapon_deagle", "ham_ItemDeploy_Post_DGL", 1);
RegisterHam(Ham_Item_Deploy, "weapon_awp", "ham_ItemDeploy_Post_AWP", 1);
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "ham_ItemDeploy_Post_AK47", 1);
register_event( "CurWeapon", "HookCurWeapon", "be", "1=1" );
register_event ( "DeathMsg", "eDeath", "a" );
/*============================
DATA/SAVING
============================*/
new DataDir [ 64 ];
get_configsdir ( DataDir, charsmax ( DataDir ) );
format ( SaveDataFile, 127, "%s/bbshopcredits.dat", DataDir );
#if USE_CONFIG_FILE == 1
set_task( 1.0, "taskLoadFile" );
#endif
}
public plugin_cfg()
{
g_iEnable = get_pcvar_num(OnOff[ gEnable ])
g_iEnableMoney = get_pcvar_num(OnOff[ gEnableMoney ])
g_iEnableCredits = get_pcvar_num(OnOff[ gEnableCredits ])
g_iEnableInfo = get_pcvar_num(OnOff[ gEnableInfo ])
g_iAntidote = get_pcvar_num(OnOff[ gAntidote ])
g_pAntidote = get_pcvar_num(PRICE[ gAntidotePrice ])
g_iHealthKit = get_pcvar_num(OnOff[ gHealthKit ])
g_pHealthKit = get_pcvar_num(PRICE[ gHealthKitPrice ])
g_aHealthKitCT = get_pcvar_num( Ammount[ g_HealthKit_CT ] )
g_aHealthKitT = get_pcvar_num( Ammount[ g_HealthKit_T ] )
g_iInfAmmo = get_pcvar_num(OnOff[ gInfAmmo ])
g_pInfAmmo = get_pcvar_num(PRICE[ gInfAmmoPrice ])
g_iNoRecoil = get_pcvar_num(OnOff[ gNoRecoil ])
g_pNoRecoil = get_pcvar_num(PRICE[ gNoRecoilPrice ])
g_iProtection = get_pcvar_num(OnOff[ gProtection ])
g_pProtection = get_pcvar_num(PRICE[ gProtectionPrice ])
g_iSpeed = get_pcvar_num(OnOff[ gSpeed ])
g_pSpeed = get_pcvar_num(PRICE[ gSpeedPrice ])
g_iGravity = get_pcvar_num(OnOff[ gGravity ])
g_pGravity = get_pcvar_num(PRICE[ gGravityPrice ])
g_iGoldenAK47 = get_pcvar_num(OnOff[ gGoldenAK47 ])
g_pGoldenAK47 = get_pcvar_num(PRICE[ gGoldenAK47Price ])
g_iGoldenAWP = get_pcvar_num(OnOff[ gGoldenAWP ])
g_pGoldenAWP = get_pcvar_num(PRICE[ gGoldenAWPPrice ])
g_iGoldenDeagle = get_pcvar_num(OnOff[ gGoldenDeagle ])
g_pGoldenDeagle = get_pcvar_num(PRICE[ gGoldenDeaglePrice ])
g_iTAuto = get_pcvar_num(OnOff[ gTAuto ])
g_pTAuto = get_pcvar_num(PRICE[ gTAutoPrice ])
g_iCTAuto = get_pcvar_num(OnOff[ gCTAuto ])
g_pCTAuto = get_pcvar_num(PRICE[ gCTAutoPrice ])
g_iSuperKnife = get_pcvar_num(OnOff[ gSuperKnife ])
g_pSuperKnife = get_pcvar_num(PRICE[ gSuperKnifePrice ])
g_iPALMgranade = get_pcvar_num(OnOff[ gPALMgranade ])
g_pPALMgranade = get_pcvar_num(PRICE[ gPALMgranadePrice ])
g_iFROSTgranade = get_pcvar_num(OnOff[ gFROSTgranade ])
g_pFROSTgranade = get_pcvar_num(PRICE[ gFROSTgranadePrice ])
g_iBOTHgranade = get_pcvar_num(OnOff[ gBOTHgranade ])
g_pBOTHgranade = get_pcvar_num(PRICE[ gFROSTPALMgranadePrice ])
g_iM249 = get_pcvar_num(OnOff[ gM249 ])
g_pM249 = get_pcvar_num(PRICE[ gM249Price ])
g_iCTShield = get_pcvar_num(OnOff[ gCTShield])
g_pCTShield = get_pcvar_num(PRICE[ gCTShieldPrice ])
g_iArmor = get_pcvar_num(OnOff[ gArmor ])
g_pArmor = get_pcvar_num(PRICE[ gArmorPrice ])
}
public HeadShopMenu( id )
{
if(!is_user_alive(id) || g_iEnable == 0)
return
if(bb_is_user_zombie(id))
{
CreditsShopMenuT( id )
}
else
{
CreditsShopMenuCT( id )
}
}
public head_shop_menu_handler(id, menu, item)
{
switch ( item )
{
case 0:
{
if(g_iEnableCredits)
{
if(bb_is_user_zombie(id))
{
CreditsShopMenuT( id )
}
else
{
CreditsShopMenuCT( id )
}
}
else
ColorChat(id, RED, "^4[ %s ] ^1Credits Shop is currently ^3DISABLED", GetPrefix())
}
case 1:
{
if(g_iEnableMoney)
{
if(bb_is_user_zombie(id))
{
MoneyShopMenuT( id )
}
else
MoneyShopMenuCT( id )
}
else
ColorChat(id, RED, "^4[ %s ] ^1Money Shop is currently ^3DISABLED", GetPrefix())
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
menu_destroy(menu)
return PLUGIN_HANDLED_MAIN
}
public CreditsShopMenuCT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ])
formatex(Item1, 127, "\yHealth Kit \r( \w+%d \r) \y[ \r%d \y]", g_aHealthKitCT, g_pHealthKit)
formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item2, 127, "\yNo Recoil [\y \r%d \y]", g_pNoRecoil)
formatex(Item2dis, 127, "\dNo Recoil \r[ DISABLED ]")
formatex(Item3, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item3dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Protection]))
formatex(Item4, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item4dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Speed]))
formatex(Item5, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item5dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
formatex(Item6, 127, "\yGolden AK47 \y[ \r%d \y]", g_pGoldenAK47)
formatex(Item6dis, 127, "\dGolden AK47 \r[ DISABLED ]")
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_ct")
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item1dis, "", 1)
case 1: menu_additem(menu, Item1dis, "", 1)
case 2: menu_additem(menu, Item1)
case 3: menu_additem(menu, Item1)
}
if(g_iNoRecoil)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iProtection)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iSpeed)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iGravity)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iGoldenAK47)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_ct(id, menu, item)
{
switch( item )
{
case 0:
{
ItemHealthKit(id)
}
case 1:
{
ItemNoRecoil(id)
}
case 2:
{
ItemProtection(id)
}
case 3:
{
ItemSpeed(id)
}
case 4:
{
ItemGravity(id)
}
case 5:
{
ItemGoldenAK47(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public CreditsShopMenuT( id )
{
new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128]
client_cmd(id, "spk %s",SOPEN);
formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ])
formatex(Item1, 127, "\yHealth Kit \r( \w+%i \r) \y[ \r%d \y]", g_aHealthKitT, g_pHealthKit)
formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]")
formatex(Item2, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection)
formatex(Item2dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Protection]))
formatex(Item3, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed)
formatex(Item3dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Speed]))
formatex(Item4, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity)
formatex(Item4dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity]))
new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_t")
switch(g_iHealthKit)
{
case 0: menu_additem(menu, Item1dis, "", 1)
case 1: menu_additem(menu, Item1)
case 2: menu_additem(menu, Item1dis, "", 1)
case 3: menu_additem(menu, Item1)
}
if(g_iProtection)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iSpeed)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iGravity)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public credits_shop_menu_handler_t(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemHealthKit(id)
}
case 1:
{
ItemProtection(id)
}
case 2:
{
ItemSpeed(id)
}
case 3:
{
ItemGravity(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
return PLUGIN_HANDLED
}
public MoneyShopMenuCT(id)
{
new MoneyTitle[128], money, Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128], Item7[128]
new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128], Item7dis[128]
client_cmd(id, "spk %s",SOPEN);
money = cs_get_user_money(id)
formatex(MoneyTitle, 127, "\r[ %s ] \yMoney Shop \r:^n\wYour Money \y: \r%d\y($)", GetPrefix(), money)
formatex(Item1, 127, "\yNapalm Nade \r[ HE ] \y[ \r%d \y]", g_pPALMgranade)
formatex(Item1dis, 127, "\dNapalm Nade [ HE ] \r[ DISABLED ]")
formatex(Item2, 127, "\yFrost Nade \y[ \r%d \y]", g_pFROSTgranade)
formatex(Item2dis, 127, "\dFrost Nade \r[ DISABLED ]")
formatex(Item3, 127, "\yBoth granade ( \wFROST \d+ \rPALM \y) \y[ \r%d \y]", g_pBOTHgranade)
formatex(Item3dis, 127, "\dBoth granade ( FROST + PALM ) \r[ DISABLED ]")
formatex(Item4, 127, "\yT Auto Sniper \y[ \r%d \y]", g_pTAuto)
formatex(Item4dis, 127, "\dT Auto Sniper \r[ DISABLED ]")
formatex(Item5, 127, "\yCT Auto Sniper \y[ \r%d \y]", g_pCTAuto)
formatex(Item5dis, 127, "\dCT Auto Sniper \r[ DISABLED ]")
formatex(Item6, 127, "\yM249 Weapon \y[ \r%d \y]", g_pM249)
formatex(Item6dis, 127, "\dM249 Weapon \r[ DISABLED ]")
formatex(Item7, 127, "\ySuper Knife \y[ \r%d \y]", g_pSuperKnife)
formatex(Item7dis, 127, "\dSuper Knife \r[ DISABLED ]")
new menu = menu_create(MoneyTitle, "money_shop_menu_handler_ct")
if(g_iPALMgranade)
menu_additem(menu, Item1)
else
menu_additem(menu, Item1dis)
if(g_iFROSTgranade)
menu_additem(menu, Item2)
else
menu_additem(menu, Item2dis)
if(g_iBOTHgranade)
menu_additem(menu, Item3)
else
menu_additem(menu, Item3dis)
if(g_iTAuto)
menu_additem(menu, Item4)
else
menu_additem(menu, Item4dis)
if(g_iCTAuto)
menu_additem(menu, Item5)
else
menu_additem(menu, Item5dis)
if(g_iM249)
menu_additem(menu, Item6)
else
menu_additem(menu, Item6dis)
if(g_iSuperKnife)
menu_additem(menu, Item7)
else
menu_additem(menu, Item7dis)
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, menu, 0)
}
public money_shop_menu_handler_ct(id, menu, item)
{
switch ( item )
{
case 0:
{
ItemPALMgranade(id)
}
case 1:
{
ItemFROSTgranade(id)
}
case 2:
{
ItemBOTHgranade(id)
}
case 3:
{
ItemTAuto(id)
}
case 4:
{
ItemCTAuto(id)
}
case 5:
{
ItemM249(id)
}
case 6:
{
ItemSuperKnife(id)
}
case MENU_EXIT:
{
client_cmd(id, "spk %s",SCLOSE);
}
}
}
public MoneyShopMenuT(id)
{
ColorChat(id, RED, "^4[ %s ] ^1This option will be available soon", GetPrefix())
return PLUGIN_HANDLED
}
public client_connect ( id )
{
NormalTrace[ id ] = 0
LoadPoints ( id )
ResetItems ( id )
}
public client_disconnect ( id )
{
SavePoints ( id )
ResetItems ( id )
}
public fwHamSpawn( id )
{
if(is_user_alive( id ))
ResetItems( id )
}
public CheckCredits(id)
{
ColorChat(id, RED, "^4[ %s ] ^1Imash ^3%i ^1kredita", GetPrefix(), Points[ id ])
}
public eDeath ( )
{
new Killer = read_data ( 1 )
new Victim = read_data ( 2 )
new HeadShoot = read_data ( 3 )
if ( Killer == Victim ) return PLUGIN_HANDLED
if ( HeadShoot )
{
if(!bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi s^x04 headshot^x01 i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 4^x04 credita");
Points [ Killer ] += 4
}
else if(bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human s^x04 headshot^x01 i poluchavate 4^x04 credita");
Points [ Killer ] += 4
}
}
else if ( !HeadShoot )
{
if(bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human i poluchavate 2^x04 credita");
Points [ Killer ] += 2
}
else if(!bb_is_user_zombie(Killer))
{
ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 2^x04 credita");
Points [ Killer ] += 2
}
}
return PLUGIN_CONTINUE
}
public cmd_give_credits( id, level,cid )
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits;
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
Points[ iTarget ] += iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: give^4 %i^3 credits to^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_take_credits(id, level,cid)
{
if ( !cmd_access ( id, level, cid, 3 ) )
return PLUGIN_HANDLED;
new szArgs[32], szAmount[ 32 ], iTarget, iCredits
read_argv( 1, szArgs, charsmax( szArgs ) );
read_argv( 2, szAmount, charsmax ( szAmount ) );
iTarget = cmd_target( id, szArgs, 8 );
if( !iTarget ) return PLUGIN_HANDLED;
new szAdminName[ 32 ], szTargetName[ 32 ];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) );
iCredits = str_to_num( szAmount );
if( Points[ iTarget ] < iCredits )
{
console_print(id, "Player %s doesn't even have %d credits! He has: %d credits.", szTargetName, iCredits, Points[ id ]);
return PLUGIN_HANDLED;
}
Points[ id ] -= iCredits;
ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: took^4 %i^3 credits from^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public cmd_give_credits_all(id, level, cid)
{
if( !cmd_access( id, level, cid, 2 ) )
return PLUGIN_HANDLED;
new szAmount[32], iCredits
read_argv(1, szAmount, charsmax ( szAmount ) );
new szAdminName[32];
get_user_name( id, szAdminName, charsmax ( szAdminName ) );
iCredits= str_to_num( szAmount );
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );
for( new i; i < iNum; i++ )
Points[ i ] = iCredits;
ColorChat( 0,GREY, "^4[%s]^3 ADMIN ^4%s^3: give^4 %i^3 credits to ^4all ^3players", GetPrefix(), szAdminName, iCredits );
SavePoints(id)
return PLUGIN_CONTINUE;
}
public LoadPoints ( id )
{
new Name [ 32 ];
get_user_name ( id, Name, 31 )
new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ]
new File = fopen ( SaveDataFile, "rt" )
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
trim ( Line );
parse ( Line, Arg1, 31, Arg2, 31 )
if ( equali ( Arg1, Name ) ) {
Points [ id ] = str_to_num ( Arg2 )
IsPlayer = true
break;
}
}
fclose ( File );
if ( !IsPlayer )
Points [ id ] = 0;
}
public SavePoints ( id )
{
new Name [ 32 ]
get_user_name ( id, Name, 31 )
new Save [ 1024 ];
format ( Save, sizeof ( Save ) -1, "^"%s^" %d", Name, Points [ id ] )
new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
new File = fopen ( SaveDataFile, "rt" );
while ( !feof ( File ) ) {
fgets ( File, Line, 127 )
parse ( Line, Arg1, 31 )
if ( equali ( Arg1, Name ) ) {
write_file ( SaveDataFile, Save, Linie )
IsPlayer = true;
break;
}
Linie++
}
fclose ( File );
if ( !IsPlayer )
write_file ( SaveDataFile, Save, -1 )
}
#if USE_CONFIG_FILE == 1
public taskLoadFile( )
{
new szFile[ 124 ], dir[ 124 ];
get_configsdir( dir, charsmax( dir ) );
formatex( szFile, charsmax ( szFile ), "%s/bbshop.cfg", dir );
if( file_exists( szFile ) )
{
server_cmd( "exec %s", szFile );
server_exec( );
}
else
{
CreateFile( szFile );
log_amx( "bbshop.cfg is not found in configs folder. File is created..." );
}
}
CreateFile( const file[ ] )
{
new i = fopen( file, "wt" );
fprintf( i, "// %s %s by %s^n" , PLUGIN, VERSION, AUTHOR);
fprintf( i, "// Do not modify, If you don't know how!!^n^n" );
fprintf( i, "//ON / OFF CORE SETTINGS^n")
fprintf( i, "//This cvar enable/disable the plugin(Default is 1)^n")
fprintf( i, "bbshop_enable ^"%i^"^n", g_iEnable)
fprintf( i, "//This cvar enable/disable the Money Shop (Default is 1)^n")
fprintf( i, "bbshop_money_shop ^"%i^"^n", g_iEnableMoney)
fprintf( i, "//This cvar enable/disable the Credits Shop (Default is 1)^n")
fprintf( i, "bbshop_credits_shop ^"%i^"^n", g_iEnableCredits)
fprintf( i, "//This cvar enable/disable the all info in chat(after picking an item, core shop menu info) (Default is 1)^n")
fprintf( i, "bbshop_enable_info ^"%i^"^n", g_iEnableInfo)
fprintf( i, "// ITEMS CONFIGURATIONS")
fprintf( i, "// I will sort them by twins first cvar is to enable/disable the item in shop. Secon cvar is the PRICE^n^n")
fprintf( i, "//------------Credits Shop------------^n^n")
fprintf( i, "//Antidote Item^n")
fprintf( i, "bbshop_antidote ^"%i^"", g_iAntidote)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pAntidote)
fprintf( i, "//HealthKit Item^n")
fprintf( i, "//0 Disable | 1 for Terrorist only | 2 for Counter-Terrorist only | 3 for all |^n")
fprintf( i, "bbshop_healthkit ^"%i^"^n", g_iHealthKit)
fprintf( i, "bbshop_healthkit_amm_ct ^"%i^" //Human Bonus HP From SHOP^n", g_aHealthKitCT)
fprintf( i, "bbshop_healthkit_amm_t ^"%i^" //Zombie Bonus HP From SHOP^n", g_aHealthKitT)
fprintf( i, "bbshop_healthkit_price ^"%i^"^n^n", g_pHealthKit)
fprintf( i, "//Infinity Ammo Item^n")
fprintf( i, "bbshop_infammo ^"%i^"^n", g_iInfAmmo)
fprintf( i, "bbshop_infammo_price ^"%i^"^n^n", g_pInfAmmo)
fprintf( i, "//No Recoil Item^n")
fprintf( i, "bbshop_norecoil ^"%i^"^n", g_iNoRecoil)
fprintf( i, "bbshop_norecoil_price ^"%i^"^n^n", g_pNoRecoil)
fprintf( i, "//Protection Item (GodMode)^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iProtection)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pProtection)
fprintf( i, "//Gravity Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iGravity)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pGravity)
fprintf( i, "//Speed Item^n")
fprintf( i, "bbshop_protection ^"%i^"^n", g_iSpeed)
fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pSpeed)
fprintf( i, "//Golden AK47 Item^n")
fprintf( i, "bbshop_goldenak ^"%i^"^n", g_iGoldenAK47)
fprintf( i, "bbshop_goldenak_price ^"%i^"^n^n", g_pGoldenAK47)
fprintf( i, "//Golden Deagle Item^n")
fprintf( i, "bbshop_goldendeagle ^"%i^"^n", g_iGoldenDeagle)
fprintf( i, "bbshop_goldendeagle_price ^"%i^"^n^n", g_pGoldenDeagle)
fprintf( i, "//Golden AWP Item^n")
fprintf( i, "bbshop_goldenawp ^"%i^"^n", g_iGoldenAWP)
fprintf( i, "bbshop_goldenawp_price ^"%i^"^n^n", g_pGoldenAWP)
fprintf( i, "//------------MONEY SHOP ( $ ) -------------^n^n")
fprintf( i, "//T Auto Item^n")
fprintf( i, "bbshop_tauto ^"%i^"^n", g_iTAuto)
fprintf( i, "bbshop_tauto_price ^"%i^"^n^n", g_pTAuto)
fprintf( i, "//CT Auto Item^n")
fprintf( i, "bbshop_ctauto ^"%i^"^n", g_iCTAuto)
fprintf( i, "bbshop_ctauto_price ^"%i^"^n^n", g_pCTAuto)
fprintf( i, "//Super Knife Item^n")
fprintf( i, "bbshop_superknife ^"%i^"^n", g_iSuperKnife)
fprintf( i, "bbshop_superknife_price ^"%i^"^n^n", g_pSuperKnife)
fprintf( i, "//PALM NADE Item (Include the PALM NADE Plugin or it will be just a HE granade)^n")
fprintf( i, "bbshop_napalmnade ^"%i^"^n", g_iPALMgranade)
fprintf( i, "bbshop_napalmnade_price ^"%i^"^n^n", g_pPALMgranade)
fprintf( i, "//FROSTNADE Item (Include the Frost Nade Plugin or it will be just a SMOKENADE)^n")
fprintf( i, "bbshop_frostnade ^"%i^"^n", g_iFROSTgranade)
fprintf( i, "bbshop_frostnade_price ^"%i^"^n^n", g_pFROSTgranade)
fprintf( i, "//Both Granades ( PALM + FROST ) Item^n")
fprintf( i, "bbshop_both ^"%i^"^n", g_iBOTHgranade)
fprintf( i, "bbshop_both_price ^"%i^"^n^n", g_pBOTHgranade)
fprintf( i, "//M249 Item^n")
fprintf( i, "bbshop_m249 ^"%i^"^n", g_iM249)
fprintf( i, "bbshop_m249_price ^"%i^"^n^n", g_pM249)
fprintf( i, "//CT Shield Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iCTShield)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pCTShield)
fprintf( i, "//Armor Item^n")
fprintf( i, "bbshop_antidote ^"%i^"^n", g_iArmor)
fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pArmor)
fprintf( i, "SPECIAL THANKS TO : AJW/1337")
fclose( i );
}
#endif
public plugin_precache()
{
precache_sound(SOPEN)
precache_sound(SCLOSE)
precache_model(g_ModelGoldenDeagle)
precache_model(g_ModelGoldenAWP)
precache_model(g_ModelGoldenAWP2)
precache_model(g_ModelGoldenAK47)
precache_model(g_ModelGoldenAK472)
precache_model(g_ModelSuperKnife)
g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1)
}
public ResetItems(id)
{
UserUses[ id ][ gAntidote ] = false
UserUses[ id ][ gHealthKit ] = false
UserUses[ id ][ gInfAmmo ] = false
UserUses[ id ][ gNoRecoil ] = false
UserUses[ id ][ gTAuto ] = false
UserUses[ id ][ gCTAuto ] = false
UserUses[ id ][ gPALMgranade ] = false
UserUses[ id ][ gBOTHgranade ] = false
UserUses[ id ][ gM249 ] = false
UserUses[ id ][ gFROSTgranade ] = false
UserUses[ id ][ gProtection ] = false
UserUses[ id ][ gCTShield ] = false
UserUses[ id ][ gSpeed ] = false
UserUses[ id ][ gGravity ] = false
UserUses[ id ][ gArmor ] = false
UserUses[ id ][ gSuperKnife ] = false
UserUses[ id ][ gGoldenAK47 ] = false
UserUses[ id ][ gGoldenAWP ] = false
UserUses[ id ][ gGoldenDeagle ] = false
}
public fwPrecacheEvent(type, const name[]) {
for (new i = 0; i < sizeof g_guns_events; ++i) {
if (equal(g_guns_events[i], name)) {
g_guns_eventids_bitsum |= (1<<get_orig_retval())
return FMRES_HANDLED
}
}
return FMRES_IGNORED
}
public fwdPlayerPreThink( id )
{
new iWeapon = get_user_weapon( id );
if ( !pev_valid( id ) )
return FMRES_IGNORED;
if ( iWeapon == CSW_AWP || iWeapon == CSW_KNIFE || iWeapon == CSW_C4 || iWeapon == CSW_HEGRENADE || iWeapon == CSW_FLASHBANG || iWeapon == CSW_SMOKEGRENADE )
return FMRES_IGNORED;
if ( UserUses[ id ][ gNoRecoil ] )
{
set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0})
}
return FMRES_IGNORED;
}
public fwTraceLine(const Float:start[3], const Float:dest[3], ignore_monsters, id, ptr) {
if (!(1 <= id <= g_max_clients))
return FMRES_IGNORED
if (!NormalTrace[id]) {
NormalTrace[id] = ptr
return FMRES_HANDLED
}
static dummy
if (ptr == NormalTrace[id] || ignore_monsters != DONT_IGNORE_MONSTERS || !is_user_alive(id) || get_user_weapon(id, dummy, dummy) == CSW_KNIFE)
return FMRES_IGNORED
fix_recoil_trace(id, start, ptr)
return FMRES_SUPERCEDE
}
public taskProtectionTimer(id)
{
//OCIXCROM
id-=TASK
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Remaining seconds %i---", g_iTimer[ id ])
// Намаляваш таймера за 1 секунда и ако е достигнал 0, премахваш task-а.
if(--g_iTimer[id] == 0)
{
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "---Protection ENDED---")
set_user_godmode(id, 0)
remove_task(id+TASK)
}
//END
}
public ItemAntidote(id)
{
if(is_user_alive(id) && bb_is_user_zombie(id))
{
if(g_iAntidote == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gAntidote ])
{
alreadyhave(id)
}
if(Points[ id ] < g_pAntidote)
{
notenough(id)
return PLUGIN_HANDLED
}
cs_set_user_team(id, CS_TEAM_CT, 7)
set_user_health(id, 100)
Points[ id ] -= g_pAntidote
UserUses[ id ][ gAntidote ] = true
if ( callfunc_begin("show_method_menu", "basebuilder65.amxx") == 1 )
{
callfunc_push_int( id )
callfunc_end( )
}
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Antidote aplied^nYou are now a HUMAN" )
}
return PLUGIN_HANDLED
}
public ItemHealthKit(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iHealthKit== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gHealthKit ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pHealthKit)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pHealthKit
UserUses[ id ][ gHealthKit ] = true
new aHealth
switch ( get_user_team(id) )
{
case 1: aHealth = get_pcvar_num(Ammount[ g_HealthKit_T])
case 2: aHealth = get_pcvar_num(Ammount[ g_HealthKit_CT])
}
set_user_health( id, get_user_health(id) + aHealth);
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully added (%d) to your health", aHealth)
}
return PLUGIN_HANDLED
}
public ItemProtection(id)
{
if(is_user_alive(id))
{
if(g_iProtection== 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gProtection ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pProtection)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_godmode(id, 1)
g_iTimer[ id ] = get_pcvar_num(Ammount[ g_Protection ])
set_task(0.5, "taskProtectionTimer", id+TASK, _,_,"b")
UserUses[ id ][ gProtection ] = true
Points[ id ] -= g_pProtection
}
return PLUGIN_HANDLED
}
public ItemSpeed(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSpeed == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSpeed ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pSpeed)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_maxspeed(id , get_pcvar_float(Ammount [ g_Speed ]))
Points[ id ] -= g_pSpeed
UserUses[ id ][ gSpeed ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your speed has been increased to %i !", get_pcvar_num(Ammount[g_Speed]))
set_user_maxspeed(id, get_pcvar_float( Ammount[ g_Speed ] ))
}
return PLUGIN_HANDLED
}
public ItemGravity(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGravity == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGravity ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGravity)
{
notenough(id)
return PLUGIN_HANDLED
}
set_user_gravity(id, get_pcvar_float(Ammount[ g_Gravity ]))
Points[ id ] -= g_pGravity
UserUses[ id ][ gGravity ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Your gravity has been decreased to %d", get_user_gravity(id))
}
return PLUGIN_HANDLED
}
public ItemNoRecoil(id)
{
//new szRandom = random(256)
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(g_iNoRecoil == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gNoRecoil ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pNoRecoil)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pNoRecoil
UserUses[ id ][ gNoRecoil ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "No Recoil on all weapons is now active" )
//set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 });
return PLUGIN_HANDLED
}
public ItemInfAmmo(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iInfAmmo == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gInfAmmo ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pInfAmmo)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pInfAmmo
UserUses[ id ][ gInfAmmo ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Unlimited Clip is now active")
}
return PLUGIN_HANDLED
}
public ItemTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pTAuto)
UserUses[ id ][ gTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought T Auto ( G3SG1 )")
give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 200);
}
return PLUGIN_HANDLED
}
public ItemCTAuto(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iCTAuto == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gCTAuto ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pCTAuto)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pCTAuto)
UserUses[ id ][ gCTAuto ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "Successfully bought CT Auto ( SG550 )")
give_item(id, "weapon_sg550")
cs_set_user_bpammo(id, CSW_SG550, 200);
}
return PLUGIN_HANDLED
}
public ItemM249(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iM249 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gM249 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pM249)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pM249)
UserUses[ id ][ gM249 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a M249 Carbine")
give_item(id, "weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 200);
}
return PLUGIN_HANDLED
}
public ItemPALMgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iPALMgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gPALMgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pPALMgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pPALMgranade)
UserUses[ id ][ gPALMgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a PALM Granade")
give_item(id, "weapon_hegranade")
}
return PLUGIN_HANDLED
}
public ItemFROSTgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iFROSTgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gFROSTgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pFROSTgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pFROSTgranade)
UserUses[ id ][ gFROSTgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought a Frost Granade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemBOTHgranade(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iBOTHgranade == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gBOTHgranade ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pBOTHgranade)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pBOTHgranade)
UserUses[ id ][ gBOTHgranade ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Both Granades ( PALM + FROST )")
give_item(id, "weapon_hegranade")
give_item(id, "weapon_smokegranade")
}
return PLUGIN_HANDLED
}
public ItemSuperKnife(id)
{
new money = cs_get_user_money(id)
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iSuperKnife == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gSuperKnife ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(money < g_pSuperKnife)
{
notenough(id)
return PLUGIN_HANDLED
}
get_user_money(id, g_pSuperKnife)
UserUses[ id ][ gSuperKnife ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Super Knife")
}
return PLUGIN_HANDLED
}
public ItemGoldenDeagle(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenDeagle == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenDeagle ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenDeagle)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenDeagle
UserUses[ id ][ gGoldenDeagle ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden DEAGLE")
strip_user_weapons(id)
give_item(id, "weapon_deagle")
give_item(id, "weapon_knife")
cs_set_user_bpammo(id, CSW_DEAGLE, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAK47(id)
{
//new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAK47 == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAK47 ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAK47)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAK47
UserUses[ id ][ gGoldenAK47 ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
show_dhudmessage( id, "You successfully bought Golden AK47")
strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 200);
}
return PLUGIN_HANDLED
}
public ItemGoldenAWP(id)
{
////new szRandom = random(256)
if(is_user_alive(id))
{
if(g_iGoldenAWP == 0)
{
ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix())
return PLUGIN_HANDLED
}
if(UserUses[ id ][ gGoldenAWP ])
{
alreadyhave(id)
return PLUGIN_HANDLED
}
if(Points[ id ] < g_pGoldenAWP)
{
notenough(id)
return PLUGIN_HANDLED
}
Points[ id ] -= g_pGoldenAWP
UserUses[ id ][ gGoldenAWP ] = true
set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 )
strip_user_weapons(id)
show_dhudmessage( id, "You successfully bought Golden AWP")
give_item(id, "weapon_awp")
give_item(id, "weapon_knife")
cs_set_user_bpammo(id, CSW_AWP, 200);
}
return PLUGIN_HANDLED
}
public ham_ItemDeploy_Post_KNI(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && UserUses[owner][ gSuperKnife ])
{
set_pev(owner, pev_viewmodel2, g_ModelSuperKnife);
}
}
public ham_ItemDeploy_Post_DGL(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenDeagle ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenDeagle);
}
}
public ham_ItemDeploy_Post_AK47(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAK47 ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAK47);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAK472))
}
}
public ham_ItemDeploy_Post_AWP(weapon_ent)
{
static owner;
owner = get_pdata_cbase(weapon_ent, 41, 4);
if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAWP ]) )
{
set_pev(owner, pev_viewmodel2, g_ModelGoldenAWP);
set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAWP2))
}
}
public Player_ResetMaxSpeed(id)
{
if( is_user_alive(id) && get_user_maxspeed(id) != -1.0 && UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount[ g_Speed ]));
}
}
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
if( !IsPlayer1( attacker ) || !is_user_alive( attacker ) || inflictor != attacker )
{
return;
}
if ( UserUses[attacker][ gSuperKnife ] && get_user_weapon(attacker) == CSW_KNIFE )
{
SetHamParamFloat( 4, damage * 231 );
}
if ( UserUses[attacker][ gGoldenAWP ] && get_user_weapon(attacker) == CSW_AWP )
{
SetHamParamFloat( 4, damage * 2 );
}
if ( UserUses[attacker][ gGoldenDeagle] && get_user_weapon(attacker) == CSW_DEAGLE )
{
SetHamParamFloat( 4, damage * 4 );
}
if ( UserUses[attacker][ gGoldenAK47 ] && ( get_user_weapon(attacker) == CSW_AK47) )
{
SetHamParamFloat( 4, damage * 1.10 );
}
}
public HookCurWeapon( id )
{
/* --| If plugin is on, and user has speed item, let's set the speed again */
if( g_iEnable != 0)
{
new iWeapon = read_data(2)
if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) && UserUses[ id ][ gInfAmmo ] )
{
fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] )
}
if(UserUses[ id ][ gSpeed ])
{
set_user_maxspeed(id, get_pcvar_float(Ammount [ g_Speed ]))
}
}
}
public alreadyhave(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You already own this item", GetPrefix())
}
public notenough(id)
{
ColorChat(id, RED, "^4[ %s ] ^1You ^3don't ^1have enough credits/money to buy this item", GetPrefix())
}
stock ResetMaxspeed( id )
{
static Float:fMaxSpeed;
ExecuteHamB( Ham_CS_Item_GetMaxSpeed, get_pdata_cbase( id, m_pActiveItem ), fMaxSpeed );
entity_set_float( id, EV_FL_maxspeed, fMaxSpeed );
}
stock GetPrefix()
{
new Prefix[33]
get_pcvar_string(gPrefix, Prefix, charsmax(Prefix))
return Prefix
}
stock get_user_money(id, Ammount)
{
new money = cs_get_user_money(id)
cs_set_user_money(id, money - Ammount, 1)
return money
}
fix_recoil_trace(id, const Float:start[], ptr) {
static Float:dest[3]
pev(id, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
}
-
sf4n
Извън линия - Потребител
- Мнения: 311
- Регистриран на: 08 Яну 2018, 11:25
- Се отблагодари: 25 пъти
- Получена благодарност: 14 пъти
Решение на няколко проблема в BB 6.5?
Проблема е, че маха и останалите оръжия, като deagle и гранати.summertime vibes написа: ↑02 Май 2020, 15:31Виж дали това ще ти реши първия проблем, с твоя код е.Код за потвърждение: Избери целия код
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #include <fun> #include <colorchat> #include <fakemeta> #include <engine> #include <xs> #if AMXX_VERSION_NUM < 183 #include <dhudmessage> #endif #define TASK 222333 #define m_pActiveItem 373 #define PLUGIN "Zombie BB Shop For 6.5 TIRANT" #define VERSION "1.0" #define AUTHOR "Just In Case" #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame #define IsPlayer1(%1) ( 1 <= %1 <= MAX_PLAYERS ) //CONFIG FILE #define USE_CONFIG_FILE 1 // weapons offsets #define OFFSET_CLIPAMMO 51 #define OFFSET_LINUX_WEAPONS 4 #define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS) const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4)) new const szChatCommands[][] = { "say /shop", "say_team /shop", "say shop", "say_team shop", "say /market", "say_team /market", "say market", "say_team market" } new const szChatCheckCredits[][] = { "say /credits", "say_team /credits", "say credits", "say_team credits", "say /points", "say_team /points", "say /ammopacks", "say_team /ammopacks", "say ammopacks", "say_team ammopacks" } new const g_guns_events[][] = { "events/awp.sc", "events/g3sg1.sc", "events/ak47.sc", "events/scout.sc", "events/m249.sc", "events/m4a1.sc", "events/sg552.sc", "events/aug.sc", "events/sg550.sc", "events/m3.sc", "events/xm1014.sc", "events/usp.sc", "events/mac10.sc", "events/ump45.sc", "events/fiveseven.sc", "events/p90.sc", "events/deagle.sc", "events/p228.sc", "events/glock18.sc", "events/mp5n.sc", "events/tmp.sc", "events/elite_left.sc", "events/elite_right.sc", "events/galil.sc", "events/famas.sc" } new const g_MaxClipAmmo[] = { 0, 13, //CSW_P228 0, 10, //CSW_SCOUT 0, //CSW_HEGRENADE 7, //CSW_XM1014 0, //CSW_C4 30,//CSW_MAC10 30, //CSW_AUG 0, //CSW_SMOKEGRENADE 15,//CSW_ELITE 20,//CSW_FIVESEVEN 25,//CSW_UMP45 30, //CSW_SG550 35, //CSW_GALIL 25, //CSW_FAMAS 12,//CSW_USP 20,//CSW_GLOCK18 10, //CSW_AWP 30,//CSW_MP5NAVY 100,//CSW_M249 8, //CSW_M3 30, //CSW_M4A1 30,//CSW_TMP 20, //CSW_G3SG1 0, //CSW_FLASHBANG 7, //CSW_DEAGLE 30, //CSW_SG552 30, //CSW_AK47 0, //CSW_KNIFE 50//CSW_P90 } enum PluginData { gEnable, gEnableMoney, gEnableCredits, gEnableInfo, gAntidote, gHealthKit, gInfAmmo, gNoRecoil, gTAuto, gCTAuto, gM249, gGoldenAK47, gGoldenAWP, gGoldenDeagle, gSuperKnife, gPALMgranade, gBOTHgranade, gFROSTgranade, gProtection, gCTShield, gSpeed, gGravity, gArmor } enum PluginPrices { gAntidotePrice, gHealthKitPrice, gInfAmmoPrice, gNoRecoilPrice, gTAutoPrice, gCTAutoPrice, gM249Price, gGoldenAK47Price, gGoldenAWPPrice, gGoldenDeaglePrice, gSuperKnifePrice, gPALMgranadePrice, gFROSTPALMgranadePrice, gFROSTgranadePrice, gProtectionPrice, gCTShieldPrice, gSpeedPrice, gGravityPrice, gArmorPrice } enum PluginAmounts { g_HealthKit_T, g_HealthKit_CT, g_Protection, g_Speed, g_Gravity } /*======================================================================= -= Нативи =- ========================================================================*/ native bb_is_user_zombie(id) //-- new const SOPEN[] = "/bbshop/sounds/open.wav" new const SCLOSE[] = "/bbshop/sounds/close.wav" new const g_ModelSuperKnife[] = "models/bbshop/models/v_super_knife.mdl"; new const g_ModelGoldenDeagle[] = "models/bbshop/models/v_golden_deagle.mdl"; new const g_ModelGoldenAK47[] = "models/bbshop/models/v_golden_ak47.mdl"; new const g_ModelGoldenAK472[] = "models/bbshop/models/p_golden_ak47.mdl"; new const g_ModelGoldenAWP[] = "models/bbshop/models/v_golden_awp.mdl"; new const g_ModelGoldenAWP2[] = "models/bbshop/models/p_golden_awp.mdl"; new OnOff[ PluginData ], PRICE[ PluginPrices ], Ammount[ PluginAmounts ], UserUses[MAX_PLAYERS][ PluginData ], Points [ MAX_PLAYERS ] new g_iEnable, g_iEnableMoney, g_iEnableCredits, g_iEnableInfo, g_iAntidote, g_iHealthKit, g_iInfAmmo, g_iNoRecoil, g_iProtection, g_iSpeed, g_iGravity, g_iTAuto, g_iCTAuto, g_iPALMgranade, g_iFROSTgranade, g_iBOTHgranade, g_iM249, g_iArmor, g_iCTShield, g_iGoldenAK47, g_iGoldenAWP, g_iGoldenDeagle, g_iSuperKnife new g_pAntidote, g_pHealthKit, g_pInfAmmo, g_pNoRecoil, g_pProtection, g_pSpeed, g_pGravity, g_pTAuto, g_pCTAuto, g_pPALMgranade, g_pFROSTgranade, g_pBOTHgranade, g_pM249, g_pArmor, g_pCTShield, g_pGoldenAK47, g_pGoldenAWP, g_pGoldenDeagle, g_pSuperKnife new g_aHealthKitCT, g_aHealthKitT new NormalTrace[ MAX_PLAYERS + 1 ], g_guns_eventids_bitsum new g_fwid new g_max_clients new g_iTimer[33] new gPrefix new SaveDataFile [ 128 ] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_max_clients = global_get(glb_maxClients) OnOff[ gEnable ] = register_cvar("bbshop_enable", "1") OnOff [ gEnableMoney ] = register_cvar("bbshop_money_shop", "0") OnOff [ gEnableCredits ] = register_cvar("bbshop_credits_shop", "1") OnOff [ gEnableInfo ] = register_cvar("bbshop_enable_info", "1") gPrefix = register_cvar("bbshop_prefix", "CS-ZAPAD") /*======================================================================= -= Магазин с КРЕДИТИ =- ========================================================================*/ OnOff [ gAntidote ] = register_cvar("bbshop_antidote", "0") PRICE [ gAntidotePrice ] = register_cvar("bbshop_antidote_price", "20") OnOff [ gHealthKit ] = register_cvar("bbshop_healtkit", "3") PRICE [ gHealthKitPrice ] = register_cvar("bbshop_healtkit_price", "30") Ammount [ g_HealthKit_CT ] = register_cvar("bbshop_healthkit_amm_ct", "50") Ammount [ g_HealthKit_T ] = register_cvar("bbshop_healthkit_amm_t", "1000") OnOff [ gInfAmmo ] = register_cvar("bbshop_infammo", "0") PRICE [ gInfAmmoPrice ] = register_cvar("bbshop_infammo_price", "50") OnOff [ gNoRecoil ] = register_cvar("bbshop_norecoil", "2") PRICE [ gNoRecoilPrice ] = register_cvar("bbshop_norecoil_price", "40") OnOff [ gProtection ] = register_cvar("bbshop_protection", "3") PRICE [ gProtectionPrice ] = register_cvar("bbshop_protection_price", "40") Ammount [ g_Protection ] = register_cvar("bbshop_proction_ammount", "3") OnOff [ gSpeed ] = register_cvar("bbshop_speed", "3") PRICE [ gSpeedPrice ] = register_cvar("bbshop_speed_price", "30") Ammount [ g_Speed ] = register_cvar("bbshop_speed_ammount", "300.0") OnOff [ gGravity ] = register_cvar("bbshop_gravity", "3") PRICE [ gGravityPrice ] = register_cvar("bbshop_gravity_price", "40") Ammount [ g_Gravity ] = register_cvar("bbshop_gravity_ammount", "0.7") OnOff [ gGoldenAK47 ] = register_cvar("bbshop_goldenak", "1") PRICE [ gGoldenAK47Price ] = register_cvar("bbshop_goldenak_price", "40") OnOff [ gGoldenAWP ] = register_cvar("bbshop_goldenawp", "0") PRICE [ gGoldenAWPPrice ] = register_cvar("bbshop_goldenawp_price", "30") OnOff [ gGoldenDeagle ] = register_cvar("bbshop_goldendeagle", "0") PRICE [ gGoldenDeaglePrice ] = register_cvar("bbshop_goldendeagle_price", "30") /*======================================================================= -= Магазин с ПАРИ ( $ ) =- ========================================================================*/ OnOff [ gTAuto ] = register_cvar("bbshop_tauto", "1") PRICE [ gTAutoPrice ] = register_cvar("bbshop_tauto_price", "16000") OnOff [ gCTAuto ] = register_cvar("bbshop_ctauto", "1") PRICE [ gCTAutoPrice ] = register_cvar("bbshop_ctauto_price", "16000") OnOff [ gSuperKnife ] = register_cvar("bbshop_superknife", "1") PRICE [ gSuperKnifePrice ] = register_cvar("bbshop_superknife_price", "16000") OnOff [ gPALMgranade ] = register_cvar("bbshop_napalmnade", "1") PRICE [ gPALMgranadePrice ] = register_cvar("bbshop_napalmnade_price", "6000") OnOff [ gFROSTgranade ] = register_cvar("bbshop_frostnade", "1") PRICE [ gFROSTgranadePrice ] = register_cvar("bbshop_frostnade_price", "7000") OnOff [ gBOTHgranade ] = register_cvar("bbshop_both", "1") PRICE [ gFROSTPALMgranadePrice ] = register_cvar("bbshop_both_price", "10000") OnOff [ gM249 ] = register_cvar("bbshop_m249", "1") PRICE [ gM249Price ] = register_cvar("bbshop_m249_price", "16000") OnOff [ gCTShield ] = register_cvar("bbshop_ctshield", "1") PRICE [ gCTShieldPrice ] = register_cvar("bbshop_ctshield_price", "6000") OnOff [ gArmor ] = register_cvar("bbshop_armor", "1") PRICE [ gArmorPrice ] = register_cvar("bbshop_armor_price", "5000") /*============================ ChatCommands ============================*/ for (new i = 0; i < sizeof szChatCommands; i++ ) register_concmd(szChatCommands[i], "HeadShopMenu") for (new i = 0; i <sizeof szChatCheckCredits; i++) register_concmd(szChatCheckCredits[i], "CheckCredits") /*============================ AdminCommands ============================*/ register_concmd( "amx_give_credits", "cmd_give_credits", ADMIN_RCON, "<name> <Credits Amount>" ); register_concmd( "amx_take_credits", "cmd_take_credits", ADMIN_RCON, "<name> <Credits Amount>" ); register_concmd( "amx_give_credits_all", "cmd_give_credits_all", ADMIN_RCON, "<Credits Amount>" ); /*============================ EVENTS/FORWARDS/HAMS ============================*/ unregister_forward(FM_PrecacheEvent, g_fwid, 1) register_forward(FM_PlayerPreThink, "fwdPlayerPreThink") register_forward(FM_TraceLine, "fwTraceLine") RegisterHam(Ham_Spawn, "player", "fwHamSpawn", 1) RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre"); RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1); RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post_KNI", 1); RegisterHam(Ham_Item_Deploy, "weapon_deagle", "ham_ItemDeploy_Post_DGL", 1); RegisterHam(Ham_Item_Deploy, "weapon_awp", "ham_ItemDeploy_Post_AWP", 1); RegisterHam(Ham_Item_Deploy, "weapon_ak47", "ham_ItemDeploy_Post_AK47", 1); register_event( "CurWeapon", "HookCurWeapon", "be", "1=1" ); register_event ( "DeathMsg", "eDeath", "a" ); /*============================ DATA/SAVING ============================*/ new DataDir [ 64 ]; get_configsdir ( DataDir, charsmax ( DataDir ) ); format ( SaveDataFile, 127, "%s/bbshopcredits.dat", DataDir ); #if USE_CONFIG_FILE == 1 set_task( 1.0, "taskLoadFile" ); #endif } public plugin_cfg() { g_iEnable = get_pcvar_num(OnOff[ gEnable ]) g_iEnableMoney = get_pcvar_num(OnOff[ gEnableMoney ]) g_iEnableCredits = get_pcvar_num(OnOff[ gEnableCredits ]) g_iEnableInfo = get_pcvar_num(OnOff[ gEnableInfo ]) g_iAntidote = get_pcvar_num(OnOff[ gAntidote ]) g_pAntidote = get_pcvar_num(PRICE[ gAntidotePrice ]) g_iHealthKit = get_pcvar_num(OnOff[ gHealthKit ]) g_pHealthKit = get_pcvar_num(PRICE[ gHealthKitPrice ]) g_aHealthKitCT = get_pcvar_num( Ammount[ g_HealthKit_CT ] ) g_aHealthKitT = get_pcvar_num( Ammount[ g_HealthKit_T ] ) g_iInfAmmo = get_pcvar_num(OnOff[ gInfAmmo ]) g_pInfAmmo = get_pcvar_num(PRICE[ gInfAmmoPrice ]) g_iNoRecoil = get_pcvar_num(OnOff[ gNoRecoil ]) g_pNoRecoil = get_pcvar_num(PRICE[ gNoRecoilPrice ]) g_iProtection = get_pcvar_num(OnOff[ gProtection ]) g_pProtection = get_pcvar_num(PRICE[ gProtectionPrice ]) g_iSpeed = get_pcvar_num(OnOff[ gSpeed ]) g_pSpeed = get_pcvar_num(PRICE[ gSpeedPrice ]) g_iGravity = get_pcvar_num(OnOff[ gGravity ]) g_pGravity = get_pcvar_num(PRICE[ gGravityPrice ]) g_iGoldenAK47 = get_pcvar_num(OnOff[ gGoldenAK47 ]) g_pGoldenAK47 = get_pcvar_num(PRICE[ gGoldenAK47Price ]) g_iGoldenAWP = get_pcvar_num(OnOff[ gGoldenAWP ]) g_pGoldenAWP = get_pcvar_num(PRICE[ gGoldenAWPPrice ]) g_iGoldenDeagle = get_pcvar_num(OnOff[ gGoldenDeagle ]) g_pGoldenDeagle = get_pcvar_num(PRICE[ gGoldenDeaglePrice ]) g_iTAuto = get_pcvar_num(OnOff[ gTAuto ]) g_pTAuto = get_pcvar_num(PRICE[ gTAutoPrice ]) g_iCTAuto = get_pcvar_num(OnOff[ gCTAuto ]) g_pCTAuto = get_pcvar_num(PRICE[ gCTAutoPrice ]) g_iSuperKnife = get_pcvar_num(OnOff[ gSuperKnife ]) g_pSuperKnife = get_pcvar_num(PRICE[ gSuperKnifePrice ]) g_iPALMgranade = get_pcvar_num(OnOff[ gPALMgranade ]) g_pPALMgranade = get_pcvar_num(PRICE[ gPALMgranadePrice ]) g_iFROSTgranade = get_pcvar_num(OnOff[ gFROSTgranade ]) g_pFROSTgranade = get_pcvar_num(PRICE[ gFROSTgranadePrice ]) g_iBOTHgranade = get_pcvar_num(OnOff[ gBOTHgranade ]) g_pBOTHgranade = get_pcvar_num(PRICE[ gFROSTPALMgranadePrice ]) g_iM249 = get_pcvar_num(OnOff[ gM249 ]) g_pM249 = get_pcvar_num(PRICE[ gM249Price ]) g_iCTShield = get_pcvar_num(OnOff[ gCTShield]) g_pCTShield = get_pcvar_num(PRICE[ gCTShieldPrice ]) g_iArmor = get_pcvar_num(OnOff[ gArmor ]) g_pArmor = get_pcvar_num(PRICE[ gArmorPrice ]) } public HeadShopMenu( id ) { if(!is_user_alive(id) || g_iEnable == 0) return if(bb_is_user_zombie(id)) { CreditsShopMenuT( id ) } else { CreditsShopMenuCT( id ) } } public head_shop_menu_handler(id, menu, item) { switch ( item ) { case 0: { if(g_iEnableCredits) { if(bb_is_user_zombie(id)) { CreditsShopMenuT( id ) } else { CreditsShopMenuCT( id ) } } else ColorChat(id, RED, "^4[ %s ] ^1Credits Shop is currently ^3DISABLED", GetPrefix()) } case 1: { if(g_iEnableMoney) { if(bb_is_user_zombie(id)) { MoneyShopMenuT( id ) } else MoneyShopMenuCT( id ) } else ColorChat(id, RED, "^4[ %s ] ^1Money Shop is currently ^3DISABLED", GetPrefix()) } case MENU_EXIT: { client_cmd(id, "spk %s",SCLOSE); } } menu_destroy(menu) return PLUGIN_HANDLED_MAIN } public CreditsShopMenuCT( id ) { new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128] new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128] client_cmd(id, "spk %s",SOPEN); formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ]) formatex(Item1, 127, "\yHealth Kit \r( \w+%d \r) \y[ \r%d \y]", g_aHealthKitCT, g_pHealthKit) formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]") formatex(Item2, 127, "\yNo Recoil [\y \r%d \y]", g_pNoRecoil) formatex(Item2dis, 127, "\dNo Recoil \r[ DISABLED ]") formatex(Item3, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection) formatex(Item3dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Protection])) formatex(Item4, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed) formatex(Item4dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_float(Ammount[g_Speed])) formatex(Item5, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity) formatex(Item5dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity])) formatex(Item6, 127, "\yGolden AK47 \y[ \r%d \y]", g_pGoldenAK47) formatex(Item6dis, 127, "\dGolden AK47 \r[ DISABLED ]") new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_ct") switch(g_iHealthKit) { case 0: menu_additem(menu, Item1dis, "", 1) case 1: menu_additem(menu, Item1dis, "", 1) case 2: menu_additem(menu, Item1) case 3: menu_additem(menu, Item1) } if(g_iNoRecoil) menu_additem(menu, Item2) else menu_additem(menu, Item2dis) if(g_iProtection) menu_additem(menu, Item3) else menu_additem(menu, Item3dis) if(g_iSpeed) menu_additem(menu, Item4) else menu_additem(menu, Item4dis) if(g_iGravity) menu_additem(menu, Item5) else menu_additem(menu, Item5dis) if(g_iGoldenAK47) menu_additem(menu, Item6) else menu_additem(menu, Item6dis) menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ); menu_display(id, menu, 0) } public credits_shop_menu_handler_ct(id, menu, item) { switch( item ) { case 0: { ItemHealthKit(id) } case 1: { ItemNoRecoil(id) } case 2: { ItemProtection(id) } case 3: { ItemSpeed(id) } case 4: { ItemGravity(id) } case 5: { ItemGoldenAK47(id) } case MENU_EXIT: { client_cmd(id, "spk %s",SCLOSE); } } return PLUGIN_HANDLED } public CreditsShopMenuT( id ) { new CreditsTitle[128], Item1[128], Item2[128], Item3[128], Item4[128] new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128] client_cmd(id, "spk %s",SOPEN); formatex(CreditsTitle, 127, "\r[ CS-ZAPAD ] \yCredits Shop \r:^n\wYour Credits \y: \r%d", Points[ id ]) formatex(Item1, 127, "\yHealth Kit \r( \w+%i \r) \y[ \r%d \y]", g_aHealthKitT, g_pHealthKit) formatex(Item1dis, 127, "\dHealth Kit \r[ DISABLED ]") formatex(Item2, 127, "\yProtection \r( \w%d s\r ) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Protection]), g_pProtection) formatex(Item2dis, 127, "\dProtection ( %d s ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Protection])) formatex(Item3, 127, "\ySpeed \r( \w%d \r) \y[ \r%d \y]", get_pcvar_num(Ammount[g_Speed]), g_pSpeed) formatex(Item3dis, 127, "\dSpeed ( %d ) \r[ DISABLED ]", get_pcvar_num(Ammount[g_Speed])) formatex(Item4, 127, "\yLower Gravity \y[ \r%d \y]", g_pGravity) formatex(Item4dis, 127, "\dLowerGravity \r[ DISABLED ]", get_pcvar_float(Ammount[g_Gravity])) new menu = menu_create(CreditsTitle, "credits_shop_menu_handler_t") switch(g_iHealthKit) { case 0: menu_additem(menu, Item1dis, "", 1) case 1: menu_additem(menu, Item1) case 2: menu_additem(menu, Item1dis, "", 1) case 3: menu_additem(menu, Item1) } if(g_iProtection) menu_additem(menu, Item2) else menu_additem(menu, Item2dis) if(g_iSpeed) menu_additem(menu, Item3) else menu_additem(menu, Item3dis) if(g_iGravity) menu_additem(menu, Item4) else menu_additem(menu, Item4dis) menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ); menu_display(id, menu, 0) } public credits_shop_menu_handler_t(id, menu, item) { switch ( item ) { case 0: { ItemHealthKit(id) } case 1: { ItemProtection(id) } case 2: { ItemSpeed(id) } case 3: { ItemGravity(id) } case MENU_EXIT: { client_cmd(id, "spk %s",SCLOSE); } } return PLUGIN_HANDLED } public MoneyShopMenuCT(id) { new MoneyTitle[128], money, Item1[128], Item2[128], Item3[128], Item4[128], Item5[128], Item6[128], Item7[128] new Item1dis[128], Item2dis[128], Item3dis[128], Item4dis[128], Item5dis[128], Item6dis[128], Item7dis[128] client_cmd(id, "spk %s",SOPEN); money = cs_get_user_money(id) formatex(MoneyTitle, 127, "\r[ %s ] \yMoney Shop \r:^n\wYour Money \y: \r%d\y($)", GetPrefix(), money) formatex(Item1, 127, "\yNapalm Nade \r[ HE ] \y[ \r%d \y]", g_pPALMgranade) formatex(Item1dis, 127, "\dNapalm Nade [ HE ] \r[ DISABLED ]") formatex(Item2, 127, "\yFrost Nade \y[ \r%d \y]", g_pFROSTgranade) formatex(Item2dis, 127, "\dFrost Nade \r[ DISABLED ]") formatex(Item3, 127, "\yBoth granade ( \wFROST \d+ \rPALM \y) \y[ \r%d \y]", g_pBOTHgranade) formatex(Item3dis, 127, "\dBoth granade ( FROST + PALM ) \r[ DISABLED ]") formatex(Item4, 127, "\yT Auto Sniper \y[ \r%d \y]", g_pTAuto) formatex(Item4dis, 127, "\dT Auto Sniper \r[ DISABLED ]") formatex(Item5, 127, "\yCT Auto Sniper \y[ \r%d \y]", g_pCTAuto) formatex(Item5dis, 127, "\dCT Auto Sniper \r[ DISABLED ]") formatex(Item6, 127, "\yM249 Weapon \y[ \r%d \y]", g_pM249) formatex(Item6dis, 127, "\dM249 Weapon \r[ DISABLED ]") formatex(Item7, 127, "\ySuper Knife \y[ \r%d \y]", g_pSuperKnife) formatex(Item7dis, 127, "\dSuper Knife \r[ DISABLED ]") new menu = menu_create(MoneyTitle, "money_shop_menu_handler_ct") if(g_iPALMgranade) menu_additem(menu, Item1) else menu_additem(menu, Item1dis) if(g_iFROSTgranade) menu_additem(menu, Item2) else menu_additem(menu, Item2dis) if(g_iBOTHgranade) menu_additem(menu, Item3) else menu_additem(menu, Item3dis) if(g_iTAuto) menu_additem(menu, Item4) else menu_additem(menu, Item4dis) if(g_iCTAuto) menu_additem(menu, Item5) else menu_additem(menu, Item5dis) if(g_iM249) menu_additem(menu, Item6) else menu_additem(menu, Item6dis) if(g_iSuperKnife) menu_additem(menu, Item7) else menu_additem(menu, Item7dis) menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ); menu_display(id, menu, 0) } public money_shop_menu_handler_ct(id, menu, item) { switch ( item ) { case 0: { ItemPALMgranade(id) } case 1: { ItemFROSTgranade(id) } case 2: { ItemBOTHgranade(id) } case 3: { ItemTAuto(id) } case 4: { ItemCTAuto(id) } case 5: { ItemM249(id) } case 6: { ItemSuperKnife(id) } case MENU_EXIT: { client_cmd(id, "spk %s",SCLOSE); } } } public MoneyShopMenuT(id) { ColorChat(id, RED, "^4[ %s ] ^1This option will be available soon", GetPrefix()) return PLUGIN_HANDLED } public client_connect ( id ) { NormalTrace[ id ] = 0 LoadPoints ( id ) ResetItems ( id ) } public client_disconnect ( id ) { SavePoints ( id ) ResetItems ( id ) } public fwHamSpawn( id ) { if(is_user_alive( id )) ResetItems( id ) } public CheckCredits(id) { ColorChat(id, RED, "^4[ %s ] ^1Imash ^3%i ^1kredita", GetPrefix(), Points[ id ]) } public eDeath ( ) { new Killer = read_data ( 1 ) new Victim = read_data ( 2 ) new HeadShoot = read_data ( 3 ) if ( Killer == Victim ) return PLUGIN_HANDLED if ( HeadShoot ) { if(!bb_is_user_zombie(Killer)) { ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi s^x04 headshot^x01 i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 4^x04 credita"); Points [ Killer ] += 4 } else if(bb_is_user_zombie(Killer)) { ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human s^x04 headshot^x01 i poluchavate 4^x04 credita"); Points [ Killer ] += 4 } } else if ( !HeadShoot ) { if(bb_is_user_zombie(Killer)) { ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte human i poluchavate 2^x04 credita"); Points [ Killer ] += 2 } else if(!bb_is_user_zombie(Killer)) { ColorChat(Killer, RED, "^x04[^x01 CS-ZAPAD ^x04]^x01 vie ubihte zombi i poluchavate ^x04 HE ^x01+^x04 Freeze ^x01granati i 2^x04 credita"); Points [ Killer ] += 2 } } return PLUGIN_CONTINUE } public cmd_give_credits( id, level,cid ) { if ( !cmd_access ( id, level, cid, 3 ) ) return PLUGIN_HANDLED; new szArgs[32], szAmount[ 32 ], iTarget, iCredits; read_argv( 1, szArgs, charsmax( szArgs ) ); read_argv( 2, szAmount, charsmax ( szAmount ) ); iTarget = cmd_target( id, szArgs, 8 ); if( !iTarget ) return PLUGIN_HANDLED; new szAdminName[ 32 ], szTargetName[ 32 ]; get_user_name( id, szAdminName, charsmax ( szAdminName ) ); get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) ); iCredits = str_to_num( szAmount ); Points[ iTarget ] += iCredits; ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: give^4 %i^3 credits to^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName ); SavePoints(id) return PLUGIN_CONTINUE; } public cmd_take_credits(id, level,cid) { if ( !cmd_access ( id, level, cid, 3 ) ) return PLUGIN_HANDLED; new szArgs[32], szAmount[ 32 ], iTarget, iCredits read_argv( 1, szArgs, charsmax( szArgs ) ); read_argv( 2, szAmount, charsmax ( szAmount ) ); iTarget = cmd_target( id, szArgs, 8 ); if( !iTarget ) return PLUGIN_HANDLED; new szAdminName[ 32 ], szTargetName[ 32 ]; get_user_name( id, szAdminName, charsmax ( szAdminName ) ); get_user_name( iTarget, szTargetName, charsmax ( szTargetName ) ); iCredits = str_to_num( szAmount ); if( Points[ iTarget ] < iCredits ) { console_print(id, "Player %s doesn't even have %d credits! He has: %d credits.", szTargetName, iCredits, Points[ id ]); return PLUGIN_HANDLED; } Points[ id ] -= iCredits; ColorChat( 0, GREY, "^4[%s]^3 ADMIN^4 %s^3: took^4 %i^3 credits from^4 %s^3.", GetPrefix(), szAdminName, iCredits, szTargetName ); SavePoints(id) return PLUGIN_CONTINUE; } public cmd_give_credits_all(id, level, cid) { if( !cmd_access( id, level, cid, 2 ) ) return PLUGIN_HANDLED; new szAmount[32], iCredits read_argv(1, szAmount, charsmax ( szAmount ) ); new szAdminName[32]; get_user_name( id, szAdminName, charsmax ( szAdminName ) ); iCredits= str_to_num( szAmount ); new iPlayers[ 32 ], iNum; get_players( iPlayers, iNum, "ch" ); for( new i; i < iNum; i++ ) Points[ i ] = iCredits; ColorChat( 0,GREY, "^4[%s]^3 ADMIN ^4%s^3: give^4 %i^3 credits to ^4all ^3players", GetPrefix(), szAdminName, iCredits ); SavePoints(id) return PLUGIN_CONTINUE; } public LoadPoints ( id ) { new Name [ 32 ]; get_user_name ( id, Name, 31 ) new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ] new File = fopen ( SaveDataFile, "rt" ) while ( !feof ( File ) ) { fgets ( File, Line, 127 ) trim ( Line ); parse ( Line, Arg1, 31, Arg2, 31 ) if ( equali ( Arg1, Name ) ) { Points [ id ] = str_to_num ( Arg2 ) IsPlayer = true break; } } fclose ( File ); if ( !IsPlayer ) Points [ id ] = 0; } public SavePoints ( id ) { new Name [ 32 ] get_user_name ( id, Name, 31 ) new Save [ 1024 ]; format ( Save, sizeof ( Save ) -1, "^"%s^" %d", Name, Points [ id ] ) new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ] new File = fopen ( SaveDataFile, "rt" ); while ( !feof ( File ) ) { fgets ( File, Line, 127 ) parse ( Line, Arg1, 31 ) if ( equali ( Arg1, Name ) ) { write_file ( SaveDataFile, Save, Linie ) IsPlayer = true; break; } Linie++ } fclose ( File ); if ( !IsPlayer ) write_file ( SaveDataFile, Save, -1 ) } #if USE_CONFIG_FILE == 1 public taskLoadFile( ) { new szFile[ 124 ], dir[ 124 ]; get_configsdir( dir, charsmax( dir ) ); formatex( szFile, charsmax ( szFile ), "%s/bbshop.cfg", dir ); if( file_exists( szFile ) ) { server_cmd( "exec %s", szFile ); server_exec( ); } else { CreateFile( szFile ); log_amx( "bbshop.cfg is not found in configs folder. File is created..." ); } } CreateFile( const file[ ] ) { new i = fopen( file, "wt" ); fprintf( i, "// %s %s by %s^n" , PLUGIN, VERSION, AUTHOR); fprintf( i, "// Do not modify, If you don't know how!!^n^n" ); fprintf( i, "//ON / OFF CORE SETTINGS^n") fprintf( i, "//This cvar enable/disable the plugin(Default is 1)^n") fprintf( i, "bbshop_enable ^"%i^"^n", g_iEnable) fprintf( i, "//This cvar enable/disable the Money Shop (Default is 1)^n") fprintf( i, "bbshop_money_shop ^"%i^"^n", g_iEnableMoney) fprintf( i, "//This cvar enable/disable the Credits Shop (Default is 1)^n") fprintf( i, "bbshop_credits_shop ^"%i^"^n", g_iEnableCredits) fprintf( i, "//This cvar enable/disable the all info in chat(after picking an item, core shop menu info) (Default is 1)^n") fprintf( i, "bbshop_enable_info ^"%i^"^n", g_iEnableInfo) fprintf( i, "// ITEMS CONFIGURATIONS") fprintf( i, "// I will sort them by twins first cvar is to enable/disable the item in shop. Secon cvar is the PRICE^n^n") fprintf( i, "//------------Credits Shop------------^n^n") fprintf( i, "//Antidote Item^n") fprintf( i, "bbshop_antidote ^"%i^"", g_iAntidote) fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pAntidote) fprintf( i, "//HealthKit Item^n") fprintf( i, "//0 Disable | 1 for Terrorist only | 2 for Counter-Terrorist only | 3 for all |^n") fprintf( i, "bbshop_healthkit ^"%i^"^n", g_iHealthKit) fprintf( i, "bbshop_healthkit_amm_ct ^"%i^" //Human Bonus HP From SHOP^n", g_aHealthKitCT) fprintf( i, "bbshop_healthkit_amm_t ^"%i^" //Zombie Bonus HP From SHOP^n", g_aHealthKitT) fprintf( i, "bbshop_healthkit_price ^"%i^"^n^n", g_pHealthKit) fprintf( i, "//Infinity Ammo Item^n") fprintf( i, "bbshop_infammo ^"%i^"^n", g_iInfAmmo) fprintf( i, "bbshop_infammo_price ^"%i^"^n^n", g_pInfAmmo) fprintf( i, "//No Recoil Item^n") fprintf( i, "bbshop_norecoil ^"%i^"^n", g_iNoRecoil) fprintf( i, "bbshop_norecoil_price ^"%i^"^n^n", g_pNoRecoil) fprintf( i, "//Protection Item (GodMode)^n") fprintf( i, "bbshop_protection ^"%i^"^n", g_iProtection) fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pProtection) fprintf( i, "//Gravity Item^n") fprintf( i, "bbshop_protection ^"%i^"^n", g_iGravity) fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pGravity) fprintf( i, "//Speed Item^n") fprintf( i, "bbshop_protection ^"%i^"^n", g_iSpeed) fprintf( i, "bbshop_protection_price ^"%i^"^n^n", g_pSpeed) fprintf( i, "//Golden AK47 Item^n") fprintf( i, "bbshop_goldenak ^"%i^"^n", g_iGoldenAK47) fprintf( i, "bbshop_goldenak_price ^"%i^"^n^n", g_pGoldenAK47) fprintf( i, "//Golden Deagle Item^n") fprintf( i, "bbshop_goldendeagle ^"%i^"^n", g_iGoldenDeagle) fprintf( i, "bbshop_goldendeagle_price ^"%i^"^n^n", g_pGoldenDeagle) fprintf( i, "//Golden AWP Item^n") fprintf( i, "bbshop_goldenawp ^"%i^"^n", g_iGoldenAWP) fprintf( i, "bbshop_goldenawp_price ^"%i^"^n^n", g_pGoldenAWP) fprintf( i, "//------------MONEY SHOP ( $ ) -------------^n^n") fprintf( i, "//T Auto Item^n") fprintf( i, "bbshop_tauto ^"%i^"^n", g_iTAuto) fprintf( i, "bbshop_tauto_price ^"%i^"^n^n", g_pTAuto) fprintf( i, "//CT Auto Item^n") fprintf( i, "bbshop_ctauto ^"%i^"^n", g_iCTAuto) fprintf( i, "bbshop_ctauto_price ^"%i^"^n^n", g_pCTAuto) fprintf( i, "//Super Knife Item^n") fprintf( i, "bbshop_superknife ^"%i^"^n", g_iSuperKnife) fprintf( i, "bbshop_superknife_price ^"%i^"^n^n", g_pSuperKnife) fprintf( i, "//PALM NADE Item (Include the PALM NADE Plugin or it will be just a HE granade)^n") fprintf( i, "bbshop_napalmnade ^"%i^"^n", g_iPALMgranade) fprintf( i, "bbshop_napalmnade_price ^"%i^"^n^n", g_pPALMgranade) fprintf( i, "//FROSTNADE Item (Include the Frost Nade Plugin or it will be just a SMOKENADE)^n") fprintf( i, "bbshop_frostnade ^"%i^"^n", g_iFROSTgranade) fprintf( i, "bbshop_frostnade_price ^"%i^"^n^n", g_pFROSTgranade) fprintf( i, "//Both Granades ( PALM + FROST ) Item^n") fprintf( i, "bbshop_both ^"%i^"^n", g_iBOTHgranade) fprintf( i, "bbshop_both_price ^"%i^"^n^n", g_pBOTHgranade) fprintf( i, "//M249 Item^n") fprintf( i, "bbshop_m249 ^"%i^"^n", g_iM249) fprintf( i, "bbshop_m249_price ^"%i^"^n^n", g_pM249) fprintf( i, "//CT Shield Item^n") fprintf( i, "bbshop_antidote ^"%i^"^n", g_iCTShield) fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pCTShield) fprintf( i, "//Armor Item^n") fprintf( i, "bbshop_antidote ^"%i^"^n", g_iArmor) fprintf( i, "bbshop_antidote_price ^"%i^"^n^n", g_pArmor) fprintf( i, "SPECIAL THANKS TO : AJW/1337") fclose( i ); } #endif public plugin_precache() { precache_sound(SOPEN) precache_sound(SCLOSE) precache_model(g_ModelGoldenDeagle) precache_model(g_ModelGoldenAWP) precache_model(g_ModelGoldenAWP2) precache_model(g_ModelGoldenAK47) precache_model(g_ModelGoldenAK472) precache_model(g_ModelSuperKnife) g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1) } public ResetItems(id) { UserUses[ id ][ gAntidote ] = false UserUses[ id ][ gHealthKit ] = false UserUses[ id ][ gInfAmmo ] = false UserUses[ id ][ gNoRecoil ] = false UserUses[ id ][ gTAuto ] = false UserUses[ id ][ gCTAuto ] = false UserUses[ id ][ gPALMgranade ] = false UserUses[ id ][ gBOTHgranade ] = false UserUses[ id ][ gM249 ] = false UserUses[ id ][ gFROSTgranade ] = false UserUses[ id ][ gProtection ] = false UserUses[ id ][ gCTShield ] = false UserUses[ id ][ gSpeed ] = false UserUses[ id ][ gGravity ] = false UserUses[ id ][ gArmor ] = false UserUses[ id ][ gSuperKnife ] = false UserUses[ id ][ gGoldenAK47 ] = false UserUses[ id ][ gGoldenAWP ] = false UserUses[ id ][ gGoldenDeagle ] = false } public fwPrecacheEvent(type, const name[]) { for (new i = 0; i < sizeof g_guns_events; ++i) { if (equal(g_guns_events[i], name)) { g_guns_eventids_bitsum |= (1<<get_orig_retval()) return FMRES_HANDLED } } return FMRES_IGNORED } public fwdPlayerPreThink( id ) { new iWeapon = get_user_weapon( id ); if ( !pev_valid( id ) ) return FMRES_IGNORED; if ( iWeapon == CSW_AWP || iWeapon == CSW_KNIFE || iWeapon == CSW_C4 || iWeapon == CSW_HEGRENADE || iWeapon == CSW_FLASHBANG || iWeapon == CSW_SMOKEGRENADE ) return FMRES_IGNORED; if ( UserUses[ id ][ gNoRecoil ] ) { set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0}) } return FMRES_IGNORED; } public fwTraceLine(const Float:start[3], const Float:dest[3], ignore_monsters, id, ptr) { if (!(1 <= id <= g_max_clients)) return FMRES_IGNORED if (!NormalTrace[id]) { NormalTrace[id] = ptr return FMRES_HANDLED } static dummy if (ptr == NormalTrace[id] || ignore_monsters != DONT_IGNORE_MONSTERS || !is_user_alive(id) || get_user_weapon(id, dummy, dummy) == CSW_KNIFE) return FMRES_IGNORED fix_recoil_trace(id, start, ptr) return FMRES_SUPERCEDE } public taskProtectionTimer(id) { //OCIXCROM id-=TASK set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "---Remaining seconds %i---", g_iTimer[ id ]) // Намаляваш таймера за 1 секунда и ако е достигнал 0, премахваш task-а. if(--g_iTimer[id] == 0) { set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "---Protection ENDED---") set_user_godmode(id, 0) remove_task(id+TASK) } //END } public ItemAntidote(id) { if(is_user_alive(id) && bb_is_user_zombie(id)) { if(g_iAntidote == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gAntidote ]) { alreadyhave(id) } if(Points[ id ] < g_pAntidote) { notenough(id) return PLUGIN_HANDLED } cs_set_user_team(id, CS_TEAM_CT, 7) set_user_health(id, 100) Points[ id ] -= g_pAntidote UserUses[ id ][ gAntidote ] = true if ( callfunc_begin("show_method_menu", "basebuilder65.amxx") == 1 ) { callfunc_push_int( id ) callfunc_end( ) } set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Antidote aplied^nYou are now a HUMAN" ) } return PLUGIN_HANDLED } public ItemHealthKit(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iHealthKit== 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gHealthKit ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pHealthKit) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pHealthKit UserUses[ id ][ gHealthKit ] = true new aHealth switch ( get_user_team(id) ) { case 1: aHealth = get_pcvar_num(Ammount[ g_HealthKit_T]) case 2: aHealth = get_pcvar_num(Ammount[ g_HealthKit_CT]) } set_user_health( id, get_user_health(id) + aHealth); set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Successfully added (%d) to your health", aHealth) } return PLUGIN_HANDLED } public ItemProtection(id) { if(is_user_alive(id)) { if(g_iProtection== 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gProtection ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pProtection) { notenough(id) return PLUGIN_HANDLED } set_user_godmode(id, 1) g_iTimer[ id ] = get_pcvar_num(Ammount[ g_Protection ]) set_task(0.5, "taskProtectionTimer", id+TASK, _,_,"b") UserUses[ id ][ gProtection ] = true Points[ id ] -= g_pProtection } return PLUGIN_HANDLED } public ItemSpeed(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iSpeed == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gSpeed ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pSpeed) { notenough(id) return PLUGIN_HANDLED } set_user_maxspeed(id , get_pcvar_float(Ammount [ g_Speed ])) Points[ id ] -= g_pSpeed UserUses[ id ][ gSpeed ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Your speed has been increased to %i !", get_pcvar_num(Ammount[g_Speed])) set_user_maxspeed(id, get_pcvar_float( Ammount[ g_Speed ] )) } return PLUGIN_HANDLED } public ItemGravity(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iGravity == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gGravity ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pGravity) { notenough(id) return PLUGIN_HANDLED } set_user_gravity(id, get_pcvar_float(Ammount[ g_Gravity ])) Points[ id ] -= g_pGravity UserUses[ id ][ gGravity ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Your gravity has been decreased to %d", get_user_gravity(id)) } return PLUGIN_HANDLED } public ItemNoRecoil(id) { //new szRandom = random(256) if(!is_user_alive(id)) return PLUGIN_HANDLED if(g_iNoRecoil == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gNoRecoil ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pNoRecoil) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pNoRecoil UserUses[ id ][ gNoRecoil ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "No Recoil on all weapons is now active" ) //set_pev(id,pev_punchangle,{ 0.0,0.0,0.0 }); return PLUGIN_HANDLED } public ItemInfAmmo(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iInfAmmo == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gInfAmmo ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pInfAmmo) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pInfAmmo UserUses[ id ][ gInfAmmo ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Unlimited Clip is now active") } return PLUGIN_HANDLED } public ItemTAuto(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iTAuto == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gTAuto ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pTAuto) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pTAuto) UserUses[ id ][ gTAuto ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Successfully bought T Auto ( G3SG1 )") give_item(id, "weapon_g3sg1") cs_set_user_bpammo(id, CSW_G3SG1, 200); } return PLUGIN_HANDLED } public ItemCTAuto(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iCTAuto == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gCTAuto ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pCTAuto) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pCTAuto) UserUses[ id ][ gCTAuto ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "Successfully bought CT Auto ( SG550 )") give_item(id, "weapon_sg550") cs_set_user_bpammo(id, CSW_SG550, 200); } return PLUGIN_HANDLED } public ItemM249(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iM249 == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gM249 ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pM249) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pM249) UserUses[ id ][ gM249 ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought a M249 Carbine") give_item(id, "weapon_m249") cs_set_user_bpammo(id, CSW_M249, 200); } return PLUGIN_HANDLED } public ItemPALMgranade(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iPALMgranade == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gPALMgranade ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pPALMgranade) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pPALMgranade) UserUses[ id ][ gPALMgranade ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought a PALM Granade") give_item(id, "weapon_hegranade") } return PLUGIN_HANDLED } public ItemFROSTgranade(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iFROSTgranade == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gFROSTgranade ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pFROSTgranade) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pFROSTgranade) UserUses[ id ][ gFROSTgranade ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought a Frost Granade") give_item(id, "weapon_smokegranade") } return PLUGIN_HANDLED } public ItemBOTHgranade(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iBOTHgranade == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gBOTHgranade ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pBOTHgranade) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pBOTHgranade) UserUses[ id ][ gBOTHgranade ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought Both Granades ( PALM + FROST )") give_item(id, "weapon_hegranade") give_item(id, "weapon_smokegranade") } return PLUGIN_HANDLED } public ItemSuperKnife(id) { new money = cs_get_user_money(id) //new szRandom = random(256) if(is_user_alive(id)) { if(g_iSuperKnife == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gSuperKnife ]) { alreadyhave(id) return PLUGIN_HANDLED } if(money < g_pSuperKnife) { notenough(id) return PLUGIN_HANDLED } get_user_money(id, g_pSuperKnife) UserUses[ id ][ gSuperKnife ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought Super Knife") } return PLUGIN_HANDLED } public ItemGoldenDeagle(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iGoldenDeagle == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gGoldenDeagle ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pGoldenDeagle) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pGoldenDeagle UserUses[ id ][ gGoldenDeagle ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought Golden DEAGLE") strip_user_weapons(id) give_item(id, "weapon_deagle") give_item(id, "weapon_knife") cs_set_user_bpammo(id, CSW_DEAGLE, 200); } return PLUGIN_HANDLED } public ItemGoldenAK47(id) { //new szRandom = random(256) if(is_user_alive(id)) { if(g_iGoldenAK47 == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gGoldenAK47 ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pGoldenAK47) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pGoldenAK47 UserUses[ id ][ gGoldenAK47 ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) show_dhudmessage( id, "You successfully bought Golden AK47") strip_user_weapons(id) give_item(id, "weapon_knife") give_item(id, "weapon_ak47") cs_set_user_bpammo(id, CSW_AK47, 200); } return PLUGIN_HANDLED } public ItemGoldenAWP(id) { ////new szRandom = random(256) if(is_user_alive(id)) { if(g_iGoldenAWP == 0) { ColorChat(id, RED, "^4[ %s ] ^1This item is temporary ^3disabled ^1for now !", GetPrefix()) return PLUGIN_HANDLED } if(UserUses[ id ][ gGoldenAWP ]) { alreadyhave(id) return PLUGIN_HANDLED } if(Points[ id ] < g_pGoldenAWP) { notenough(id) return PLUGIN_HANDLED } Points[ id ] -= g_pGoldenAWP UserUses[ id ][ gGoldenAWP ] = true set_dhudmessage( 66, 134, 244, -1.0, 0.80, 1, 6.0, 3.0, 0.2, 1.5 ) strip_user_weapons(id) show_dhudmessage( id, "You successfully bought Golden AWP") give_item(id, "weapon_awp") give_item(id, "weapon_knife") cs_set_user_bpammo(id, CSW_AWP, 200); } return PLUGIN_HANDLED } public ham_ItemDeploy_Post_KNI(weapon_ent) { static owner; owner = get_pdata_cbase(weapon_ent, 41, 4); if(is_user_alive(owner) && UserUses[owner][ gSuperKnife ]) { set_pev(owner, pev_viewmodel2, g_ModelSuperKnife); } } public ham_ItemDeploy_Post_DGL(weapon_ent) { static owner; owner = get_pdata_cbase(weapon_ent, 41, 4); if(is_user_alive(owner) && ( UserUses[owner][ gGoldenDeagle ]) ) { set_pev(owner, pev_viewmodel2, g_ModelGoldenDeagle); } } public ham_ItemDeploy_Post_AK47(weapon_ent) { static owner; owner = get_pdata_cbase(weapon_ent, 41, 4); if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAK47 ]) ) { set_pev(owner, pev_viewmodel2, g_ModelGoldenAK47); set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAK472)) } } public ham_ItemDeploy_Post_AWP(weapon_ent) { static owner; owner = get_pdata_cbase(weapon_ent, 41, 4); if(is_user_alive(owner) && ( UserUses[owner][ gGoldenAWP ]) ) { set_pev(owner, pev_viewmodel2, g_ModelGoldenAWP); set_pev(owner, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ModelGoldenAWP2)) } } public Player_ResetMaxSpeed(id) { if( is_user_alive(id) && get_user_maxspeed(id) != -1.0 && UserUses[ id ][ gSpeed ]) { set_user_maxspeed(id, get_pcvar_float(Ammount[ g_Speed ])); } } public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits) { if( !IsPlayer1( attacker ) || !is_user_alive( attacker ) || inflictor != attacker ) { return; } if ( UserUses[attacker][ gSuperKnife ] && get_user_weapon(attacker) == CSW_KNIFE ) { SetHamParamFloat( 4, damage * 231 ); } if ( UserUses[attacker][ gGoldenAWP ] && get_user_weapon(attacker) == CSW_AWP ) { SetHamParamFloat( 4, damage * 2 ); } if ( UserUses[attacker][ gGoldenDeagle] && get_user_weapon(attacker) == CSW_DEAGLE ) { SetHamParamFloat( 4, damage * 4 ); } if ( UserUses[attacker][ gGoldenAK47 ] && ( get_user_weapon(attacker) == CSW_AK47) ) { SetHamParamFloat( 4, damage * 1.10 ); } } public HookCurWeapon( id ) { /* --| If plugin is on, and user has speed item, let's set the speed again */ if( g_iEnable != 0) { new iWeapon = read_data(2) if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) && UserUses[ id ][ gInfAmmo ] ) { fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] ) } if(UserUses[ id ][ gSpeed ]) { set_user_maxspeed(id, get_pcvar_float(Ammount [ g_Speed ])) } } } public alreadyhave(id) { ColorChat(id, RED, "^4[ %s ] ^1You already own this item", GetPrefix()) } public notenough(id) { ColorChat(id, RED, "^4[ %s ] ^1You ^3don't ^1have enough credits/money to buy this item", GetPrefix()) } stock ResetMaxspeed( id ) { static Float:fMaxSpeed; ExecuteHamB( Ham_CS_Item_GetMaxSpeed, get_pdata_cbase( id, m_pActiveItem ), fMaxSpeed ); entity_set_float( id, EV_FL_maxspeed, fMaxSpeed ); } stock GetPrefix() { new Prefix[33] get_pcvar_string(gPrefix, Prefix, charsmax(Prefix)) return Prefix } stock get_user_money(id, Ammount) { new money = cs_get_user_money(id) cs_set_user_money(id, money - Ammount, 1) return money } fix_recoil_trace(id, const Float:start[], ptr) { static Float:dest[3] pev(id, pev_v_angle, dest) engfunc(EngFunc_MakeVectors, dest) global_get(glb_v_forward, dest) xs_vec_mul_scalar(dest, 9999.0, dest) xs_vec_add(start, dest, dest) engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr) }
Единствен по рода си Zombie BaseBuilder с уникален мод и коректни админи по всяко време в сървъра.
IP: bb.cs-zapad.eu:27013
Respawn сървър.
IP: re.cs-zapad.eu:27015
Furien сървър.
IP: fu.cs-zapad.eu:27016
Нашият Сайт
Нашият Форум
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 0 Отговори
- 1222 Преглеждания
-
Последно мнение от beready4me
-
- 3 Отговори
- 1745 Преглеждания
-
Последно мнение от menkisa
-
- 3 Отговори
- 273 Преглеждания
-
Последно мнение от illusion
-
- 11 Отговори
- 1004 Преглеждания
-
Последно мнение от rozoveca
-
- 3 Отговори
- 1946 Преглеждания
-
Последно мнение от impossible
-
- 0 Отговори
- 1175 Преглеждания
-
Последно мнение от Shoko
-
- 7 Отговори
- 2559 Преглеждания
-
Последно мнение от M36
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 19 госта