|
开学后就没认真玩过CS了,今天中午跟同学乱侃就写了一个可以买血的插件。安装插件后随时按L键就可以用$1500(可以通过CVAR设置)把血加满。
唯一的CVAR是amx_healthprice=1500
内部命令是amx_buyhealth,在客户端连接时会被自动绑定到L键
/* AMX Mod script.
*
* (c) 2003, Potter
* This file is provided as is (no warranties).
*/
#include <amxmod>
#include <fun>
public plugin_init(){
register_plugin("BuyHealth","0.9","default")
register_cvar("amx_healthprice","1500")
register_clcmd("amx_buyhealth","buyHealth",0,"amx_buyhealth")
}
public buyHealth(id){
new health=get_user_health(id)
new money=get_user_money(id)
new price=get_cvar_num("amx_healthprice")
if (is_user_alive(id)==1 && health<100 && money>=price) {
set_user_money(id,money-price)
set_user_health(id,100)
new name[32]
get_user_name(id,name,31)
client_print(0,print_chat,"%s buy health to 100",name)
}
return PLUGIN_HANDLED
}
public client_connect(id){
client_cmd(id,"bind l amx_buyhealth")
return PLUGIN_CONTINUE
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|