廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 1611 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
23208367
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x24 鮮花 x29
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] sma的問題
我寫了一個插件,用在nst大亂鬥的

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "zbu_tr"
#define VERSION "1.0"
#define AUTHOR "kevin"
new icon
new color=255
public plugin_init()
{
    register_plugin( PLUGIN, VERSION, AUTHOR )
    register_event( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" )
    icon=get_user_msgid("StatusIcon")
}
public event_round_start()
{
       if(get_user_team(1) == CS_TEAM_T)
       {
          begin_spr(0)
       }
}
public begin_spr(id)
{
        remove_task(id)
        message_begin(MSG_ONE,icon,{0,0,0},id)
        write_byte(0)
        write_string("zbu_tr")
        write_byte(0)
        write_byte(0)
        write_byte(0)
        message_end()
        set_task(0.1,"show_spr",id,"",0,"b")
}
public show_spr(id)
{
        color-=5
               
        if(color>0)
        {
                message_begin(MSG_ONE,icon,{0,0,0},id)
                write_byte(1)
                write_string("zbu_tr")
                write_byte(color)
                write_byte(color)
                write_byte(color)
                message_end()
        }
        else
        {
                color=0
                message_begin(MSG_ONE,icon,{0,0,0},id)
                write_byte(0)
                write_string("zbu_tr")
                write_byte(color)
                write_byte(color)
                write_byte(color)
                message_end()
                remove_task(id)
        }
}


可是,一進遊戲選了tr以後,就被彈了出來(選ct不會)
說:Host_Error: WriteDest_Parm: not a clien
這是什麼問題,amxx的問題嗎??



獻花 x0 回到頂端 [樓 主] From:香港特別行政區 | Posted:2011-03-26 11:14 |
Abcdzxc555
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x71 鮮花 x83
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

把public event_round_start()
改成
public event_round_start()
{
    for (new id = 1; id <= 32; id++)
    {
        if (is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_T)
            begin_spr(id)
    }
}
試試看


獻花 x0 回到頂端 [1 樓] From:香港網上行 | Posted:2011-03-26 14:50 |
史來姆
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x370 鮮花 x529
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

begin_spr(0)
這個就是問題所在吧
玩家id是介乎 1-32
你把function執行在id = 0
當然會出錯了,,,


獻花 x0 回到頂端 [2 樓] From:香港網上行 | Posted:2011-03-26 23:27 |
23208367
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x24 鮮花 x29
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

2樓的方法ok了


獻花 x0 回到頂端 [3 樓] From:香港特別行政區 | Posted:2011-03-27 12:55 |

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