|
发表于 2010-4-29 10:33:30
|
显示全部楼层
来自 中国–广东–东莞
- #include <amxmodx>
- #include <cstrike>
- #include <fun>
- new bool:buyswitch
-
- public plugin_init() {
- register_plugin("buyweapon","1.0","bruto")
- register_clcmd("buym4ak","m4ak")
- register_event("HLTV","eResetHUD","a","a=0","2=0")
- }
- public m4ak(id) {
- if(!is_user_alive(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
- return PLUGIN_CONTINUE
-
- if(!buyswitch){
- client_print(id, print_center,"购买时间已过")
- return PLUGIN_CONTINUE
- }
- if(cs_get_user_hasprim(id)){
- client_print(id, print_center,"你已经拥有一个主武器")
- return PLUGIN_CONTINUE
- }
-
- new idmoney = cs_get_user_money2(id)
- if(cs_get_user_team(id)==CS_TEAM_CT){
- if(idmoney >= 2500){
- give_item(id, "weapon_ak47")
- cs_set_user_money2(id,idmoney - 2500)
- }
- else
- client_print(id, print_center,"金钱不足")
- }
- else{
- if(idmoney >= 3100){
- give_item(id, "weapon_m4a1")
- cs_set_user_money2(id,idmoney - 3100)
- }
- else
- client_print(id, print_center,"金钱不足")
- }
- return PLUGIN_CONTINUE
- }
- public eResetHUD(){
- new Float:buytime=get_cvar_float("mp_buytime")*60
- buyswitch=true
- set_task(buytime,"buy")
- }
- public buy(){
- buyswitch=false
- }
复制代码 这是我自己改过的插件
只需要buym4ak命令自动判断队伍枪只
枪只金钱保持原CS枪只的价钱
买到枪只不提示
跟原来买枪的效果差不多
就是不论在什么地点都可以买,但需要购买时间 |
|