|
发表于 2010-4-27 07:54:26
|
显示全部楼层
来自 中国–广东–中山
- #include <amxmodx>
- #include <cstrike>
- #include <fun>
- //#define DEBUG
- new bool:buyswitch
- public plugin_init() {
- register_plugin("buy m4ak","2.3","kid741010")
- register_clcmd("say /m4","M4")
- register_clcmd("say /ak","AK")
- register_cvar("m4cost","3100")
- register_cvar("akcost","2500")
- register_logevent("round_start",2,"0=World triggered","1=Round_Start")
- //1.5就用这句
- register_event("ResetHUD", "eResetHUD", "be")
- //1.6就用这句
- //register_event("HLTV","eResetHUD","a","a=0","2=0")
- }
- public M4(id) {
- new m4cost = get_cvar_num("m4cost")
- new money = cs_get_user_money(id)
- if(!is_user_alive(id)) {
- client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
- //client_print(id,print_chat,"Huo ZHe Cai Neng Mai^n")
- return PLUGIN_CONTINUE
- }
- if(money < m4cost) {
- client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)){ //增加行
- client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money(id,money-m4cost)
- give_item(id, "weapon_m4a1")
- cs_set_user_bpammo(id,CSW_M4A1,90)
- }
- return PLUGIN_CONTINUE
- }
- public AK(id) {
- new akcost = get_cvar_num("akcost")
- new moneyy = cs_get_user_money(id)
- if(!is_user_alive(id)) {
- client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
- return PLUGIN_CONTINUE
- }
- if(moneyy < akcost) {
- client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)) { //增加行
- client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money(id,moneyy-akcost)
- give_item(id, "weapon_ak47")
- cs_set_user_bpammo(id,CSW_AK47,90)
- }
- return PLUGIN_CONTINUE
- }
- public eResetHUD()
- {
- new Float:buytime=get_cvar_float("mp_buytime")*60
- buyswitch=true
- set_task(buytime,"buy")
- }
- public buy()
- {
- buyswitch=false
- }
- public round_start()
- {
- client_print(0,print_chat,"CT Gou Mai AK T Gou Mai M4a1 say/m4 & say/ak")
-
- }
- public client_color(playerid, colorid, msg[])
- {
- message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
- write_byte(colorid)
- write_string(msg)
- message_end()
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
- */
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|