廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 3715 個閱讀者
 
<<   1   2  下頁 >>(共 2 頁)
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
tw2twtw
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x50 鮮花 x548
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] (SMA)設置某時間執行指令....
問題1

請問如何把下面的 if 變成倒數時間的限制.... 
就是在時間到時執行當殭屍王....

 // 當剩下最後一隻喪屍時,設定讓他變成喪屍王.
 if (ts_num == 1)
 {
  static last_zombie_id
  last_zombie_id = ts[0]
  
  if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了
  {
   g_survivor_class[last_zombie_id] = 0
   g_boss[last_zombie_id] = true
   set_boss_model(last_zombie_id)
   play_boss_ambience_sound()
   fm_set_user_health(last_zombie_id, g_boss_health)
   g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
   fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
   set_task(1.0, "boss_beacon_effect", last_zombie_id)
   
   static tname[32]
   get_user_name(last_zombie_id, tname, charsmax(tname))
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
   //show_hudmessage(0, "%s is the Boss!!!", tname)
   ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
   log_amx("殭屍王出現了,目前第%d局!",g_level)
  }
 }

問題2~

我用了sk大的模組被攻擊範圍....當殭屍王變成殘達時是有成功....((用nst 動作100多的殘達
但是到下局時"當過殭屍王的小殭擁有達叔的被攻擊範圍"......
希望可以設定,下局時會清除這局的效力...


[ 此文章被tw2twtw在2010-11-27 06:48重新編輯 ]



我的SV: 59.126.178.46:27015
模式:亂七八糟?
獻花 x0 回到頂端 [樓 主] From:台灣中華電信 | Posted:2010-11-24 21:45 |
chuchung712 會員卡
個人頭像
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 社區建設獎 優秀管理員勳章 特殊貢獻獎-2
知名人士
級別: 知名人士 該用戶目前不上站
推文 x774 鮮花 x1169
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

問題1只要用set_task就好了


沒有理想的世界
獻花 x0 回到頂端 [1 樓] From:香港有線寬頻 | Posted:2010-11-24 22:03 |
tw2twtw
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x50 鮮花 x548
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

set_task要怎麼用阿.... 表情
是遊戲中下面的黃色倒數?


我的SV: 59.126.178.46:27015
模式:亂七八糟?
獻花 x0 回到頂端 [2 樓] From:台灣中華電信 | Posted:2010-11-24 22:40 |
chuchung712 會員卡
個人頭像
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 社區建設獎 優秀管理員勳章 特殊貢獻獎-2
知名人士
級別: 知名人士 該用戶目前不上站
推文 x774 鮮花 x1169
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

複製程式
 {
...
...
if (ts_num == 1)
 {
  static last_zombie_id
  last_zombie_id = ts[0]
  
  if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了
  {
   set_task(【時間】, "set_boss", last_zombie_id)  //此行的【時間】要輸入數值
  }
 } 
}

public set_boss(last_zombie_id)
{
   g_survivor_class[last_zombie_id] = 0
   g_boss[last_zombie_id] = true
   set_boss_model(last_zombie_id)
   play_boss_ambience_sound()
   fm_set_user_health(last_zombie_id, g_boss_health)
   g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
   fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
   set_task(1.0, "boss_beacon_effect", last_zombie_id)
   
   static tname[32]
   get_user_name(last_zombie_id, tname, charsmax(tname))
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
   //show_hudmessage(0, "%s is the Boss!!!", tname)
   ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
   log_amx("殭屍王出現了,目前第%d局!",g_level)
}


沒有理想的世界
獻花 x0 回到頂端 [3 樓] From:香港有線寬頻 | Posted:2010-11-24 22:44 |
tw2twtw
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x50 鮮花 x548
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

我想設的是遊戲下面的黃色倒數.....
而且是要來取代下面這段..... 表情
// 當剩下最後一隻喪屍時,設定讓他變成喪屍王.
if (ts_num == 1)


我的SV: 59.126.178.46:27015
模式:亂七八糟?
獻花 x0 回到頂端 [4 樓] From:台灣中華電信 | Posted:2010-11-25 21:21 |
i-c0112
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x6 鮮花 x194
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

不知道這樣行不行
我想應該不行吧 因為這邊的 if 不是每秒判斷的
複製程式
new Float:time_round_start
public event_round_start{
 ...
 time_round_start = get_gametime()
}

if (get_gametime() - time_round_start >= xx.xx && !g_endround)
{ 
  static last_zombie_id 
  last_zombie_id = ts[0] 
   
  if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了 
  { 
   g_survivor_class[last_zombie_id] = 0 
   g_boss[last_zombie_id] = true 
   set_boss_model(last_zombie_id) 
   play_boss_ambience_sound() 
   fm_set_user_health(last_zombie_id, g_boss_health) 
   g_user_maxspeed[last_zombie_id] = g_boss_maxspeed 
   fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id]) 
   set_task(1.0, "boss_beacon_effect", last_zombie_id) 
    
   static tname[32] 
   get_user_name(last_zombie_id, tname, charsmax(tname)) 
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1) 
   //show_hudmessage(0, "%s is the Boss!!!", tname) 
   ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname) 
   log_amx("殭屍王出現了,目前第%d局!",g_level) 
  }
 else if (!g_endround)
 {
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1) 
   ShowSyncHudMsg(0, g_hudSync3, "%.2f秒後出現殭屍王!!!", xx.xx - (time_round_start - get_gametime()) ) 
 }
} 



[ 此文章被i-c0112在2010-11-25 23:05重新編輯 ]


獻花 x0 回到頂端 [5 樓] From:台灣中華電信 | Posted:2010-11-25 22:56 |
i-c0112
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x6 鮮花 x194
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

不知改成這樣如何
懶得編排 請見諒表情
複製程式
new Float:time_round_start
public event_round_start
{
 ...
 time_round_start = get_gametime()
set_task(1.0, "check", 0112, _, _, b)
}

if (get_gametime() - time_round_start >= xx.xx && !g_endround)
{ 
  static last_zombie_id 
  last_zombie_id = ts[0] 
   
  if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了 
  { 
   g_survivor_class[last_zombie_id] = 0 
   g_boss[last_zombie_id] = true 
   set_boss_model(last_zombie_id) 
   play_boss_ambience_sound() 
   fm_set_user_health(last_zombie_id, g_boss_health) 
   g_user_maxspeed[last_zombie_id] = g_boss_maxspeed 
   fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id]) 
   set_task(1.0, "boss_beacon_effect", last_zombie_id) 
    
   static tname[32] 
   get_user_name(last_zombie_id, tname, charsmax(tname)) 
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1) 
   //show_hudmessage(0, "%s is the Boss!!!", tname) 
   ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname) 
   log_amx("殭屍王出現了,目前第%d局!",g_level) 
  }
} 

public check(id)
{
  if(get_gametime() - time_round_start >= xx.xx && !g_endround)
    {
     remove_task(0112)    

      new i = random_num(1, g_maxplayers)
      while(!g_zombie[i] || !is_user_alive(i) || !g_boss[i])
        i = random_num(1, g_maxplayers)
 
   g_survivor_class[last_zombie_id] = 0 
   g_boss[last_zombie_id] = true 
   set_boss_model(last_zombie_id) 
   play_boss_ambience_sound() 
   fm_set_user_health(last_zombie_id, g_boss_health) 
   g_user_maxspeed[last_zombie_id] = g_boss_maxspeed 
   fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id]) 
   set_task(1.0, "boss_beacon_effect", last_zombie_id) 
    
   static tname[32] 
   get_user_name(last_zombie_id, tname, charsmax(tname)) 
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1) 
   //show_hudmessage(0, "%s is the Boss!!!", tname) 
   ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname) 
   log_amx("殭屍王出現了,目前第%d局!",g_level) 
    }
 else if (!g_endround)
  {
   set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1) 
   ShowSyncHudMsg(0, g_hudSync3, "%.2f秒後出現殭屍王!!!", xx.xx - (time_round_start - get_gametime()) ) 
  }
}


獻花 x0 回到頂端 [6 樓] From:台灣中華電信 | Posted:2010-11-25 23:19 |
tw2twtw
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x50 鮮花 x548
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

if 不是每秒判斷的

我不是要每秒判斷.......只是在某時某刻會出殭屍王.......((這樣會不會比較簡單?
如:SV回合設置3分鐘...在最後一分鐘時執行當屍王的指令.... ((不用顯示也可....


[ 此文章被tw2twtw在2010-11-26 21:51重新編輯 ]


我的SV: 59.126.178.46:27015
模式:亂七八糟?
獻花 x0 回到頂端 [7 樓] From:台灣中華電信 | Posted:2010-11-26 21:39 |
i-c0112
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x6 鮮花 x194
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 tw2twtw 於 2010-11-26 21:39 發表的 : 到引言文
if 不是每秒判斷的

我不是要每秒判斷.......只是在某時某刻會出殭屍王.......((這樣會不會比較簡單?
如:SV回合設置3分鐘...在最後一分鐘時執行當屍王的指令.... ((不用顯示也可....
我當然知道if不是每秒判斷的= ="
只是這裡只給片段源碼不好改

可以在回合開始時用set_task
或是在RoundTime的event裡判斷時間


獻花 x0 回到頂端 [8 樓] From:台灣中華電信 | Posted:2010-11-27 11:21 |
tw2twtw
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x50 鮮花 x548
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

那我還是給全部原碼好了......
指令在2382行.......

順便問一下..... set_task(60.0, " " ) 後面的是執行的public ?
威望要 50 以上才可以下載附件,您目前威望不足,請勿購買


本帖包含附件
zip zombiehell20.rar   (2022-06-09 14:16 / 29 KB)   下載次數:2 需要威望:50


我的SV: 59.126.178.46:27015
模式:亂七八糟?
獻花 x0 回到頂端 [9 樓] From:台灣中華電信 | Posted:2010-11-27 23:30 |

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