Buna Ziua , am inceput sa lucrez la un script mai exact un meniu doar pentru vip , am sa postez aici sursa si as dori sa mi se adauge la furien unde e katana, sa se puna super knife-ul ,locatia lui ii in cstrike/models/v_knife_frfreakz.mdl , sa fie folosit doar de cei care au flag-ul "Q" , si sa mai poata avea 2 arme cand apesi 1 ,de asemenea sa poata fi accessat doar de vipi
sursa :
#include <amxmodx>
#include <fun>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <amxmisc>
#include <hamsandwich>
const MAX_PLAYERS = 32
new g_bHasAutoBhop[MAX_PLAYERS+1]
new jumpnum[33] = 0
new bool:dojump[33] = false
public plugin_init()
{
register_plugin( "furiens_shop", "1.2", "Gae si Jupi");
RegisterHam(Ham_Player_Jump, "player", "Ham_CBasePlayer_Jump_Pre")
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
register_logevent("round_end", 2, "1=Round_End");
register_clcmd("say /vip", "shopmenu")
register_dictionary( "shop_furiens.txt");
}
public Player_Spawn(id)
{
g_bHasAutoBhop[id] = false
jumpnum[id] = 0
dojump[id] = false
}
public shopmenu(id)
{
if(is_user_alive(id) && cs_get_user_team( id ) == CS_TEAM_CT)
{
new Menu = menu_create("Anti-Furien Shop VIP :", "montrer_menu")
menu_additem(Menu, "HE Granade [300 $]", "1", 0)
menu_additem(Menu, "Flash Granade[200 $]", "2", 0)
menu_additem(Menu, "Smoke Granade [200 $]", "3", 0)
menu_additem(Menu, "NightVision [10000 $]", "4", 0)
menu_additem(Menu, "+50 HP [800 $]", "5", 0)
menu_additem(Menu, "+200 Armure [1500$]", "6", 0)
menu_additem(Menu, "MachineGun [10000 $]", "7", 0)
menu_setprop(Menu,MPROP_EXITNAME,"Exit")
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, Menu, 0)
}
if(is_user_alive(id) && cs_get_user_team( id ) == CS_TEAM_T)
{
new Menu2 = menu_create("Furien Shop VIP:", "tero_menu")
menu_additem(Menu2, "Katana [3000 $]", "1", 0)
menu_additem(Menu2, "He Granade [300 $]", "2", 0)
menu_additem(Menu2, "Flash Granade [200 $]", "3", 0)
menu_additem(Menu2, "Smoke Granade [200 $]", "4", 0)
menu_additem(Menu2, "+50 HP [800 $]", "5", 0)
menu_additem(Menu2, "+200 Armure [1500 $]", "6", 0)
menu_setprop(Menu2,MPROP_EXITNAME,"Exit")
menu_setprop(Menu2, MPROP_EXIT, MEXIT_ALL)
menu_display(id, Menu2, 0)
}
}
public montrer_menu(id, Menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}
// variables
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu, item, iAccess, iData, 5, iName, 63, iCallback)
switch (str_to_num(iData))
{
case 1:
{
if(cs_get_user_money(id) < 300)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
//return PLUGIN_HANDLED;
client_print(id, print_chat, "%L", id, "SHOP_ITEM_DEATH");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 300)
give_item(id, "weapon_hegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_1");
}
}
case 2:
{
if(cs_get_user_money(id) < 200)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_flashbang")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_2");
}
}
case 3:
{
if(cs_get_user_money(id) < 200)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_smokegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_3");
}
}
case 4:
{
if(cs_get_user_money(id) < 10000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_set_user_nvg(id,1)
cs_take_user_money(id, 10000)
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_4");
}
}
case 5:
{
if(cs_get_user_money(id) < 800)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 800)
set_user_health( id, get_user_health(id) + 50 );
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_5");
}
}
case 6:
{
if(cs_get_user_money(id) < 1500)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 1500)
set_user_armor(id, get_user_armor(id) + 300);
client_print(id, print_chat,"%L",id, "SHOP_ITEMCT_6");
}
}
case 7:
{
if(cs_get_user_money(id) < 10000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 10000)
strip_user_weapons(id)
give_item(id,"weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 200)
}
}
}
return PLUGIN_HANDLED
}
public tero_menu(id, Menu2, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu2)
return PLUGIN_HANDLED
}
// variables
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu2, item, iAccess, iData, 5, iName, 63, iCallback)
switch (str_to_num(iData))
{
case 1:
{
if(cs_get_user_money(id) < 3000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 3000)
give_item(id, "v_superknife_")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_1");
}
}
case 2:
{
if(cs_get_user_money(id) < 300)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 300)
give_item(id, "weapon_hegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_2");
}
}
case 3:
{
if(cs_get_user_money(id) < 200)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_flashbang")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_3");
}
}
case 4:
{
if(cs_get_user_money(id) < 200)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_smokegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_4");
}
}
case 5:
{
if(cs_get_user_money(id) < 800)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST" );
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 800)
set_user_health( id, get_user_health(id) + 50 );
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_5");
}
}
case 6:
{
if(cs_get_user_money(id) < 1500)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 1500)
set_user_armor(id, get_user_armor(id) + 200);
client_print(id, print_chat,"%L",id, "SHOP_ITEMT_6");
}
}
case 7:
{
if(cs_get_user_money(id) < 3000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 16000)
give_item(id,"weapon_deagle")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_7");
}
}
}
return PLUGIN_HANDLED
}
stock cs_take_user_money(id, amount)
{
new money = cs_get_user_money(id)
if (money - amount < 0)
return 0
cs_set_user_money(id, clamp( money - amount, 0, 25000))
return 1
}
public client_connect(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}
public client_putinserver(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}
public client_disconnect(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}
public round_end(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}
public Ham_CBasePlayer_Jump_Pre(id)
{
if( g_bHasAutoBhop[id] && is_user_alive(id) )
{
if( pev(id, pev_flags) & (FL_WATERJUMP|FL_ONGROUND) == FL_ONGROUND
&& pev(id, pev_waterlevel) < 2 )
{
new iOldButtons = pev(id, pev_oldbuttons)
if( iOldButtons & IN_JUMP )
{
set_pev(id, pev_oldbuttons, iOldButtons & ~IN_JUMP)
}
}
}
}
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < 1)
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
|