- 听众
- 收听
- 积分
- 373
- 主题
- 回帖
- 0
- 精华
注册时间2009-1-6
最后登录1970-1-1
该用户从未签到
|
- // 請尊重他人勞動尊重版權謝謝 darKZol_huai@163.com
- // 隨便東拼西湊了下測試可用有問題請論壇PM如果汝有更好的建議請告訴吾
- #include <amxmodx>
- #include <amxmisc>
- #include <fun>
- #include <cstrike>
- new max_hp=100
- new max_armor=100
- new set_hp=5
- new set_armor=5
- public plugin_init()
- {
- register_plugin("Hp & Armor","1.3","天下第一小賤人")
- }
- public client_putinserver(id)
- {
- SetHp(111223+id)
- SetArmor(111224+id)
- }
- public SetHp(id)
- {
- id = id - 111223
- if(!is_user_connected(id)) {
- remove_task(111223 + id)
- log_amx("remove_task id %d",id)
- } else {
- if(is_user_alive(id)){
- if(get_user_health(id)<max_hp) {
- log_amx("SetHp id %d",id)
- new num=get_user_health(id) + set_hp
- if(num>max_hp)
- {
- set_user_health(id,max_hp)
- }
- else
- {
- set_user_health(id,get_user_health(id) + set_hp)
- }
- }
- }
- }
- set_task(1.0,"SetHp",111223+id)
- return PLUGIN_HANDLED
- }
- public SetArmor(id)
- {
- id = id - 111224
- if(!is_user_connected(id)) {
- remove_task(111224 + id)
- log_amx("remove_task id %d",id)
- } else {
- if(is_user_alive(id)){
- if(get_user_armor(id)<max_armor) {
- log_amx("SetArmor id %d",id)
- new num=get_user_armor(id) + set_armor
- if(num>max_armor) {
- cs_set_user_armor(id,max_armor,CS_ARMOR_VESTHELM)
- }
- else {
- cs_set_user_armor(id,get_user_armor(id) + set_armor,CS_ARMOR_VESTHELM)
- }
- }
- }
- }
- set_task(1.0,"SetArmor",111224+id)
- return PLUGIN_HANDLED
- }
复制代码 |
评分
-
查看全部评分
|