廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 2586 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
laiholun
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] 另外還有一個關於魔王模式的問題
我想把魔王的血量改到40000 可是改完之後好樣都沒有反應.我不知道我有沒有打錯--人類也是一樣,改完之後魔王都是100000和人類是150
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define STR_T           32
// Stock from fakemeta_util, ported by xPaw
#define fm_get_user_button(%1) pev(%1, pev_button)
#define fm_get_entity_flags(%1) pev(%1, pev_flags)
stock fm_set_user_velocity(entity, const Float:vector[3]) {
 set_pev(entity, pev_velocity, vector);
 return 1;
}
#define FALL_VELOCITY 350.0
new PLUGIN_NAME[] = "打王模式"
new PLUGIN_VERSION[] = "1.0"
new PLUGIN_AUTHOR[] = "T1nG 修改"
new bool:g_WallClimb[33]
new Float:g_wallorigin[32][3]
new cvar_bs_wallclimb
new p_climb_speed
new v_bossknife[] = "models/v_knife.mdl"
new p_bossknife[] = "models/p_knife.mdl"
new g_time
new g_amount
new bool:HasSuit[33]
new bool:falling[33]
public plugin_init()
{
 register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
 register_forward(FM_Touch,   "fwd_touch")
 register_forward(FM_PlayerPreThink,  "fwd_playerprethink")
 register_forward(FM_PlayerPostThink,  "fwd_playerpostthink")
 register_event("DeathMsg","EventDeathMsg","a")
 cvar_bs_wallclimb = register_cvar("bs_wallclimb", "0")    //王爬牆方法 1|2
 p_climb_speed = register_cvar("bs_climb_speed", "0")     //王爬牆速度 499
 register_cvar("bs_invis", "255")                            //王透明度 30
 register_cvar("bs_speed", "700")                           //王走路速度
 register_event("CurWeapon", "curwep", "be", "1=1")
 RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
 g_time = register_cvar("regen_time", "0")                   //回血多少秒一次 1
 g_amount = register_cvar("regen_amount", "0")               //回血多少一次 1
 register_event("Damage", "SetRegeneration", "be", "2>0")
}
public EventDeathMsg() 
{
 new id = read_data(2)
 g_WallClimb[id] = true
 set_user_footsteps(id, 0)
 set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,255)
 entity_set_string(id, EV_SZ_viewmodel, "models/v_knife.mdl")
        entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl")
 set_user_health(id, 300)
 set_user_maxspeed(id, 2000)
 HasSuit[id] = false
 falling[id] = false
 
 return PLUGIN_HANDLED
}
public client_connect(id) {
 g_WallClimb[id] = true 
 HasSuit[id] = false
 falling[id] = false
}
public fwd_touch(id, world)
{
 if(!is_user_alive(id) || !g_WallClimb[id])
  return FMRES_IGNORED
 
 new classname[STR_T]
 pev(world, pev_classname, classname, (STR_T-1))
 
 if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable"))
  pev(id, pev_origin, g_wallorigin[id])
 return FMRES_IGNORED
}
 
public fwd_playerprethink(id)
{
 if(!g_WallClimb[id] || !is_user_alive(id))
  return FMRES_IGNORED
 new button = fm_get_user_button(id)
 
 if((get_pcvar_num(cvar_bs_wallclimb) == 1) && (button & IN_JUMP) && cs_get_user_team(id) == CS_TEAM_T) //按跳 = climb
 {
  static Float:origin[3]
  pev(id, pev_origin, origin)
  if(get_distance_f(origin, g_wallorigin[id]) > 10.0)
   return FMRES_IGNORED  // if not near wall
  
  if(fm_get_entity_flags(id) & FL_ONGROUND)
   return FMRES_IGNORED
   
  if(button & IN_FORWARD)
  {
   static Float:velocity[3]
   velocity_by_aim(id, get_pcvar_num(p_climb_speed), velocity)
   fm_set_user_velocity(id, velocity)
  }
  else if(button & IN_BACK)
  {
   static Float:velocity[3]
   velocity_by_aim(id, -get_pcvar_num(p_climb_speed), velocity)
   fm_set_user_velocity(id, velocity)
  }
 }
 
 else if((get_pcvar_num(cvar_bs_wallclimb) == 2) && (button & IN_FORWARD) && cs_get_user_team(id) == CS_TEAM_T) //按向前+離地 = climb
 {
  static Float:origin[3]
  pev(id, pev_origin, origin)
  if(get_distance_f(origin, g_wallorigin[id]) > 10.0)
   return FMRES_IGNORED  // if not near wall
  
  if(fm_get_entity_flags(id) & FL_ONGROUND)
   return FMRES_IGNORED
   
  if(button & IN_FORWARD)
  {
   static Float:velocity[3]
   velocity_by_aim(id, get_pcvar_num(p_climb_speed), velocity)
   fm_set_user_velocity(id, velocity)
  }
  else if(button & IN_BACK)
  {
   static Float:velocity[3]
   velocity_by_aim(id, -get_pcvar_num(p_climb_speed), velocity)
   fm_set_user_velocity(id, velocity)
  }
 }

 return FMRES_IGNORED
}
public Player_Spawn_Post( id ) {
 
 if( is_user_alive(id) ) {
  cs_reset_user_model(id)
  
  if( cs_get_user_team(id) == CS_TEAM_T) {
   HasSuit[id] = true
   client_print(id, print_chat, "現在你就是一隻魔王")
   client_print(id, print_chat, "你會有 40000 HP 和 550 點速度")
   cs_set_user_model(id, "terror")
   set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,get_cvar_num("bs_invis"))
   set_user_footsteps(id, 1)
   set_user_health(id, 40000)
   server_cmd("cl_forwardspeed 600")
   server_cmd("cl_backspeed 550")
   server_cmd("cl_sidespeed 575")
   server_cmd("sv_maxspeed 2000")
   entity_set_string(id, EV_SZ_viewmodel, v_bossknife)
          entity_set_string(id, EV_SZ_weaponmodel, p_bossknife)
   set_task(0.2, "nadeloop", id)

  } 
  if( cs_get_user_team(id) == CS_TEAM_CT) {
          strip_user_weapons(id)
   client_print(id, print_chat, "現在你就是一個人類")
   client_print(id, print_chat, "你的角色 MODEL 跟隊友是一樣的")
   cs_set_user_model(id, "urban")
   set_user_health(id, 200)
   give_item(id, "weapon_knife")
  }

  return PLUGIN_HANDLED
 }
 return PLUGIN_HANDLED
}
public nadeloop(id) {
 
 if( !HasSuit[id] ) {
  remove_task(id)
 }
 
 if( HasSuit[id] ) {
  
  new i, nNum, nWeapon[32]
  new bool:HasNade[33]
  
  for(i = 0; i < nNum; i++)
  {
   if(nWeapon == CSW_SMOKEGRENADE && nWeapon == CSW_FLASHBANG) HasNade[id] = true
  }
  
  if( !HasNade[id] ) {
   give_item(id, "weapon_hegrenade")
   set_task(0.5, "nadeloop", id, "b")
  }
 }
}
public curwep(id) {
 
 new wpnID = read_data(2)
 
 if( HasSuit[id] ) {
  
  if(wpnID != CSW_KNIFE && wpnID != CSW_SMOKEGRENADE && wpnID != CSW_FLASHBANG) {
   
  engclient_cmd(id, "weapon_knife")
  set_user_footsteps(id, 1)
  entity_set_string(id, EV_SZ_viewmodel, v_bossknife)
         entity_set_string(id, EV_SZ_weaponmodel, p_bossknife)
 }
 
  if(wpnID == CSW_KNIFE) {
   entity_set_string(id, EV_SZ_viewmodel, v_bossknife)
          entity_set_string(id, EV_SZ_weaponmodel, p_bossknife)
   set_user_footsteps(id, 1)
  }
  
  if(wpnID == CSW_SMOKEGRENADE) {
   set_user_footsteps(id, 1)
  }
  
  if(wpnID == CSW_FLASHBANG) {
   set_user_footsteps(id, 1)
  }
 }
 
 if( !HasSuit[id] ) {
  
  set_user_footsteps(id, 0)
 }
 return PLUGIN_HANDLED
}
public plugin_precache() {
 
 precache_model(v_bossknife)
 precache_model("models/v_knife.mdl")
 precache_model(p_bossknife)
}
public client_PreThink(id) {
  if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) {
    if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
      falling[id] = true;
    } else {
      falling[id] = false;
    }
    set_pev(id,pev_maxspeed,get_cvar_num("bs_speed")+0.0)
  }
}
public client_PostThink(id) {
  if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) {
    if(falling[id]) {
      entity_set_int(id, EV_INT_watertype, -3);
    }
  }
}
public SetRegeneration(id)
{
 if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) {
      if (get_user_health(id) < 135)
         set_task(get_pcvar_float(g_time), "Regenerate", id, _, _, "b")
 }
 return PLUGIN_CONTINUE
}
public Regenerate(id)
{
 new regen_health = get_user_health(id)
 new max_health = 135 - regen_health
 
 if (max_health <= get_pcvar_num(g_amount))
 {
  set_pev(id, pev_health, regen_health + float(max_health))
  remove_task(id)
 }
   
 set_pev(id, pev_health, regen_health + get_pcvar_float(g_amount))
 return PLUGIN_CONTINUE
}



獻花 x0 回到頂端 [樓 主] From:未知地址 | Posted:2012-07-13 07:03 |
離之彥 會員卡
個人頭像
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 社區建設獎
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x400 鮮花 x513
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

初次判定 應該是有其他插件去衝到


回想看看 有沒有其他插件也是改血量的


因為在這原碼中 set_user_health沒有設定除了 40000、200、300 以外的數值


所以應該不是單純的只有這裡的問題...


獻花 x0 回到頂端 [1 樓] From:臺灣中華電信股份有限公司 | Posted:2012-07-13 10:00 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.089676 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言