|
发表于 2012-12-9 13:52:46
|
显示全部楼层
来自 中国–内蒙古–通辽–科尔沁区
【【【【【官网的源码】】】】】】
/*
* _______ _ _ __ __
* | _____/ | | | | \ \ __ / /
* | | | | | | | | / \ | |
* | | | |____| | | |/ __ \| |
* | | ___ | ______ | | / \ |
* | | |_ | | | | | | / \ |
* | | | | | | | | | | | |
* | |____| | | | | | | | | |
* |_______/ |_| |_| \_/ \_/
*
*
*
* Last Edited: 01-05-08
*
* ============
* Changelog:
* ============
*
* v1.0
* -Initial Release
*
*/
#define VERSION "2.0"
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
new blah[33]
new blah2[33]
new const menu1_weapon_names_T[10][32] =
{
"weapon_glock18", "400",
"weapon_usp", "500",
"weapon_p228", "600",
"weapon_deagle", "650",
"weapon_elite", "800"
}
new const menu1_weapon_names_CT[10][32] =
{
"weapon_glock18", "400",
"weapon_usp", "500",
"weapon_p228", "600",
"weapon_deagle", "650",
"weapon_fiveseven", "750"
}
new const menu2_weapon_names_T[4][32] =
{
"weapon_m3", "1700",
"weapon_xm1014", "3000"
}
new const menu2_weapon_names_CT[4][32] =
{
"weapon_m3", "1700",
"weapon_xm1014", "3000"
}
new const menu3_weapon_names_T[8][32] =
{
"weapon_mac10", "1400",
"weapon_mp5navy", "1500",
"weapon_ump45", "1700",
"weapon_p90", "2350"
}
new const menu3_weapon_names_CT[8][32] =
{
"weapon_tmp", "1250",
"weapon_mp5navy", "1500",
"weapon_ump45", "1700",
"weapon_p90", "2350"
}
new const menu4_weapon_names_T[12][32] =
{
"weapon_galil", "2000",
"weapon_ak47", "2500",
"weapon_scout", "2750",
"weapon_sg552", "3500",
"weapon_awp", "4750",
"weapon_g3sg1", "5000"
}
new const menu4_weapon_names_CT[12][32] =
{
"weapon_famas", "2250",
"weapon_scout", "2750",
"weapon_m4a1", "3100",
"weapon_aug", "3500",
"weapon_sg550", "4200",
"weapon_awp", "4750"
}
new const menu5_weapon_names_T[2][32] =
{
"weapon_m249", "5750"
}
new const menu5_weapon_names_CT[2][32] =
{
"weapon_m249", "5750"
}
new const keys = 511
new maxplayers
new bool:justdropped[33]
new primcvar, seccvar
public plugin_init()
{
register_plugin("CS Pickup Multiple Weapons",VERSION,"GHW_Chronic")
//Old Style Menus
register_menucmd(register_menuid("BuyPistol",1),keys,"hook_menu1")
register_menucmd(register_menuid("BuyShotgun",1),keys,"hook_menu2")
register_menucmd(register_menuid("BuySub",1),keys,"hook_menu3")
register_menucmd(register_menuid("BuyRifle",1),keys,"hook_menu4")
register_menucmd(register_menuid("BuyMachine",1),keys,"hook_menu5")
//VGUI Menus
register_menucmd(-29,keys,"hook_menu1")
register_menucmd(-30,keys,"hook_menu2")
register_menucmd(-32,keys,"hook_menu3")
register_menucmd(-31,keys,"hook_menu4")
register_menucmd(-33,keys,"hook_menu5")
register_forward(FM_Touch,"FM_Touch_hook")
register_clcmd("drop","dropped")
maxplayers = get_maxplayers()
primcvar = register_cvar("max_primary","3")
seccvar = register_cvar("max_secnodary","3")
}
public dropped(id)
{
justdropped[id]=true
set_task(0.5,"notdropped",id)
}
public notdropped(id) justdropped[id]=false
public hook_menu1(id,key) return hook_menus(1,id,key)
public hook_menu2(id,key) return hook_menus(2,id,key)
public hook_menu3(id,key) return hook_menus(3,id,key)
public hook_menu4(id,key) return hook_menus(4,id,key)
public hook_menu5(id,key) return hook_menus(5,id,key)
public hook_menus(menu,id,key)
{
//Send Info to the weapon handler function.
static weapon[32]
new CsTeams:team = cs_get_user_team(id)
switch(menu)
{
case 1:
{
switch(team)
{
case CS_TEAM_T: format(weapon,31,menu1_weapon_names_T[key*2])
case CS_TEAM_CT: format(weapon,31,menu1_weapon_names_CT[key*2])
}
}
case 2:
{
switch(team)
{
case CS_TEAM_T: format(weapon,31,menu2_weapon_names_T[key*2])
case CS_TEAM_CT: format(weapon,31,menu2_weapon_names_CT[key*2])
}
}
case 3:
{
switch(team)
{
case CS_TEAM_T: format(weapon,31,menu3_weapon_names_T[key*2])
case CS_TEAM_CT: format(weapon,31,menu3_weapon_names_CT[key*2])
}
}
case 4:
{
switch(team)
{
case CS_TEAM_T: format(weapon,31,menu4_weapon_names_T[key*2])
case CS_TEAM_CT: format(weapon,31,menu4_weapon_names_CT[key*2])
}
}
case 5:
{
switch(team)
{
case CS_TEAM_T: format(weapon,31,menu5_weapon_names_T[key*2])
case CS_TEAM_CT: format(weapon,31,menu5_weapon_names_CT[key*2])
}
}
}
new price
switch(menu)
{
case 1:
{
switch(team)
{
case CS_TEAM_T: price = str_to_num(menu1_weapon_names_T[key*2 + 1])
case CS_TEAM_CT: price = str_to_num(menu1_weapon_names_CT[key*2 + 1])
}
}
case 2:
{
switch(team)
{
case CS_TEAM_T: price = str_to_num(menu2_weapon_names_T[key*2 + 1])
case CS_TEAM_CT: price = str_to_num(menu2_weapon_names_CT[key*2 + 1])
}
}
case 3:
{
switch(team)
{
case CS_TEAM_T: price = str_to_num(menu3_weapon_names_T[key*2 + 1])
case CS_TEAM_CT: price = str_to_num(menu3_weapon_names_CT[key*2 + 1])
}
}
case 4:
{
switch(team)
{
case CS_TEAM_T: price = str_to_num(menu4_weapon_names_T[key*2 + 1])
case CS_TEAM_CT: price = str_to_num(menu4_weapon_names_CT[key*2 + 1])
}
}
case 5:
{
switch(team)
{
case CS_TEAM_T: price = str_to_num(menu5_weapon_names_T[key*2 + 1])
case CS_TEAM_CT: price = str_to_num(menu5_weapon_names_CT[key*2 + 1])
}
}
}
return handle_weapon(id,weapon,price)
}
public handle_weapon(id,weapon[32],price)
{
//Check for if they already have it & if they have the cash.
if(cs_user_has_weapon(id,get_weaponid(weapon)))
{
client_print(id,print_center,"You already own that weapon.")
engclient_cmd(id,"menuselect","10")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<price)
{
client_print(id,print_center,"You have insufficient funds!")
engclient_cmd(id,"menuselect","10")
return PLUGIN_HANDLED
}
new weaptype = weapon_type(get_weaponid(weapon))
if(weaptype==1 && count_weaps(id,1)>=get_pcvar_num(primcvar) || weaptype==2 |
|