Kód: Vybrat vše
#include <amxmisc>
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "JB Shop"
#define VERSION "1.0"
#define AUTHOR "RayCodeCSC"
new setModel_zvon[33]
new setModel_sekacik[33]
new setModel_maceta[33]
new setModel_motorpila[33]
new setModel_superknife[33]
new setModel_handT[33]
new setModel_handCT[33]
//p = Vidíš ho v ruke druhému hráčovi
//v = Vidíš si ho v ruke ty
new const p_model_zvon[] = "models/jb_shop/zvon/zvon.mdl"
new const v_model_zvon[] = "models/jb_shop/zvon/zvon2.mdl"
new const p_model_sekacik[] = "models/jb_shop/sekacik/sekacik.mdl"
new const v_model_sekacik[] = "models/jb_shop/sekacik/sekacik2.mdl"
new const p_model_maceta[] = "models/jb_shop/maceta/maceta.mdl"
new const v_model_maceta[] = "models/jb_shop/maceta/maceta2.mdl"
new const p_model_motorpila[] = "models/jb_shop/motorpila/motorpila.mdl"
new const v_model_motorpila[] = "models/jb_shop/motorpila/motorpila2.mdl"
new const p_model_superknife[] = "models/jb_shop/superknife/superknife.mdl"
new const v_model_superknife[] = "models/jb_shop/superknife/superknife2.mdl"
new const p_model_handCT[] = "models/jb_shop/Electro/Electro.mdl"
new const v_model_handCT[] = "models/jb_shop/Electro/Electro2.mdl"
new const p_model_handT[] = "models/jb_shop/Punos/Punos.mdl"
new const v_model_handT[] = "models/jb_shop/Punos/Punos2.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /jbshop", "shop_menu")
register_clcmd("say /s", "shop_menu")
register_clcmd("amx_jbshop", "shop_menu")
register_event("CurWeapon", "weapon_skins", "be", "1=1")
RegisterHam(Ham_Spawn, "player", "afterSpawn")
RegisterHam(Ham_TakeDamage, "player", "isDamaged")
}
public plugin_precache()
{
precache_model(p_model_zvon)
precache_model(p_model_sekacik)
precache_model(p_model_motorpila)
precache_model(p_model_maceta)
precache_model(p_model_superknife)
precache_model(p_model_handT)
precache_model(p_model_handCT)
precache_model(v_model_zvon)
precache_model(v_model_sekacik)
precache_model(v_model_maceta)
precache_model(v_model_superknife)
precache_model(v_model_motorpila)
precache_model(v_model_handT)
precache_model(v_model_handCT)
}
public weapon_skins(id)
{
new weapid = read_data(2)
if(weapid == CSW_KNIFE)
{
if(setModel_zvon[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_zvon)
set_pev(id, pev_weaponmodel2, v_model_zvon)
}
else if(setModel_sekacik[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_sekacik)
set_pev(id, pev_weaponmodel2, v_model_sekacik)
}
else if(setModel_maceta[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_maceta)
set_pev(id, pev_weaponmodel2, v_model_maceta)
}
else if(setModel_motorpila[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_motorpila)
set_pev(id, pev_weaponmodel2, v_model_motorpila)
}
else if(setModel_superknife[id] == 1)
{
set_pev(id, pev_viewmodel2, v_model_superknife)
set_pev(id, pev_weaponmodel2, p_model_superknife)
}
else if(setModel_handT[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_handT)
set_pev(id, pev_weaponmodel2, v_model_handT)
}
else if(setModel_handCT[id] == 1)
{
set_pev(id, pev_viewmodel2, p_model_handCT)
set_pev(id, pev_weaponmodel2, v_model_handCT)
}
}
}
public afterSpawn(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
setModel_handT[id] = 1
setModel_zvon[id] = 0
setModel_sekacik[id] = 0
setModel_motorpila[id] = 0
setModel_maceta[id] = 0
setModel_handCT[id] = 0
setModel_superknife[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
client_cmd(id, "amx_jbshop")
}
else if(cs_get_user_team(id) == CS_TEAM_CT)
{
setModel_handT[id] = 0
setModel_zvon[id] = 0
setModel_sekacik[id] = 0
setModel_motorpila[id] = 0
setModel_maceta[id] = 0
setModel_handCT[id] = 1
setModel_superknife[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
client_cmd(id, "amx_jbshop")
}
}
public isDamaged(victim, attacker, id)
{
if(setModel_zvon[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 35)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 15)
}
}
else if(setModel_sekacik[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 60)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 35)
}
}
else if(setModel_maceta[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 85)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 60)
}
}
else if(setModel_motorpila[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 65)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 150)
}
}
else if(setModel_superknife[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 100)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 99999)
}
}
else if(setModel_handCT[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 50)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 70)
}
}
else if(setModel_handT[id] == 1)
{
set_user_armor(victim, get_user_armor(victim) - 30)
if(get_user_armor(victim) == 0)
{
set_user_health(victim, get_user_health(victim) - 10)
}
}
}
public shop_menu(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
new t_shop = menu_create("Obchod pre T:", "shop_t_menu_selection")
menu_additem(t_shop, "Zachodovy zvon (\y500$\w)") //Zvon, 500$
menu_additem(t_shop, "Sekacik na maso (\y1200$\w)") //Sekacik, 1200$
menu_additem(t_shop, "Maceta \r*VIP* \w(\y1600$\w)") //Maceta, VIP, 1600$
menu_additem(t_shop, "Motorova Pila \r*VIP* \w(\y2500$\w)") //Mot. Pila, VIP, 2500$
menu_additem(t_shop, "Super Knife \r*VIP* \w(\y4500$\w)") //Super Knife, VIP, 4500$
menu_additem(t_shop, "Deagle \r*VIP* \w(\y2800$\w)") //Deagle, VIP, 2800$
menu_display(id, t_shop)
}
else if(cs_get_user_team(id) == CS_TEAM_CT)
{
new ct_shop = menu_create("Obchod pre CT:", "shop_ct_menu_selection")
menu_additem(ct_shop, "Zakladne Zbrane \r*VIP*")
menu_additem(ct_shop, "AK-47")
menu_additem(ct_shop, "M4A1")
menu_additem(ct_shop, "DEAGLE")
menu_additem(ct_shop, "AWP")
menu_additem(ct_shop, "Zdravie + Vesta \r*VIP* \w(\y1100$\w)")//Zdravie a vesta, VIP, 1100$
menu_display(id, ct_shop)
}
}
public shop_t_menu_selection(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
if(cs_get_user_money(id) >= 500)
{
setModel_zvon[id] = 1
setModel_sekacik[id] = 0
setModel_motorpila[id] = 0
setModel_superknife[id] = 0
setModel_maceta[id] = 0
setModel_handT[id] = 0
setModel_handCT[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
cs_set_user_money(id, cs_get_user_money(id) - 500)
}
else if(cs_get_user_money(id) < 500)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
case 1:
{
if(cs_get_user_money(id) >= 1200)
{
setModel_zvon[id] = 0
setModel_sekacik[id] = 1
setModel_motorpila[id] = 0
setModel_superknife[id] = 0
setModel_maceta[id] = 0
setModel_handT[id] = 0
setModel_handCT[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
cs_set_user_money(id, cs_get_user_money(id) - 1200)
}
else if(cs_get_user_money(id) < 1200)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
case 2:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(cs_get_user_money(id) >= 1600)
{
setModel_zvon[id] = 0
setModel_sekacik[id] = 0
setModel_motorpila[id] = 0
setModel_superknife[id] = 0
setModel_maceta[id] = 1
setModel_handCT[id] = 0
setModel_handT[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
cs_set_user_money(id, cs_get_user_money(id) - 1600)
}
else if(cs_get_user_money(id) < 1600)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
case 3:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(cs_get_user_money(id) >= 2500)
{
setModel_zvon[id] = 0
setModel_sekacik[id] = 0
setModel_motorpila[id] = 1
setModel_superknife[id] = 0
setModel_maceta[id] = 0
setModel_handT[id] = 0
setModel_handCT[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
cs_set_user_money(id, cs_get_user_money(id) - 2500)
}
else if(cs_get_user_money(id) < 2500)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
case 4:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(cs_get_user_money(id) >= 4500)
{
setModel_zvon[id] = 0
setModel_superknife[id] = 1
setModel_sekacik[id] = 0
setModel_motorpila[id] = 0
setModel_maceta[id] = 0
setModel_handCT[id] = 0
setModel_handT[id] = 0
strip_user_weapons(id)
give_item(id, "weapon_knife")
cs_set_user_money(id, cs_get_user_money(id) - 4500)
}
else if(cs_get_user_money(id) < 4500)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
case 5:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(cs_get_user_money(id) >= 2800)
{
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 1)
cs_set_user_money(id, cs_get_user_money(id) - 2800)
}
else if(cs_get_user_money(id) < 2800)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
}
}
public shop_ct_menu_selection(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_m4a1")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_AK47, 99999)
cs_set_user_bpammo(id, CSW_M4A1, 99999)
cs_set_user_bpammo(id, CSW_DEAGLE, 99999)
set_user_health(id, 250)
set_user_armor(id, 250)
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
case 1:
{
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 120)
}
case 2:
{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 120)
}
case 3:
{
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 10)
}
case 4:
{
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 120)
}
case 5:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(cs_get_user_money(id) >= 1100)
{
set_user_health(id, 250)
set_user_armor(id, 250)
cs_set_user_money(id, cs_get_user_money(id) - 1100)
}
else if(cs_get_user_money(id) < 1100)
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nemas dostatok penazi!")
}
}
else
{
client_print(id, print_chat, "[JAILBREAK-SHOP] Nie si VIP!")
}
}
}
}