kining2008 發表於 6-1-2011 13:12:56

sma一問

迎來我自己寫緊1個說話系統, 但係我有d野唔係幾明..
公開頻道叫做CS_TEAM_UNASSIGNED同埋cs_get_user_team(id)
旁觀者叫做CS_TEAM_SPECTATOR
咁死亡果陣時講野既原碼係咩??
仲有, 組別說話時既原碼都咩??

求高手幫幫手..我唔識

又畀cs板主ban左 發表於 6-1-2011 14:24:18

register_clcmd("say_team","function")

if(!is_user_alive(id))
{
   code...
}

tony987852 發表於 6-1-2011 17:07:02

樓上...不如成個sma寫出黎;P

kining2008 發表於 6-1-2011 19:00:35

仲係唔得...
error 035: argument type mismatch <argument 3>
應該點修正?

tony987852 發表於 6-1-2011 21:26:39

睇下第幾行出錯

kining2008 發表於 6-1-2011 22:26:30

本帖最後由 kining2008 於 6-1-2011 22:37 編輯

line 11
register_clcmd("say_team","function","say","sign_say",ADMIN_ALL,"- Colored Sign Chat")
有咩問題??
二樓那名高人叫我加上"say_team","function"的...另外果d本身已加,,

chantikki 發表於 6-1-2011 22:59:36

本帖最後由 chantikki 於 6-1-2011 23:21 編輯

register_clcmd("say_team","function_name")

public function_name(id)
{
      new name
      new test
      get_user_name(id, name, 32)
      read_args(text,191)
      remove_quotes(text)

      if (equal(text, ""))
                return PLUGIN_HANDLED

      new loop
      switch (cs_get_user_team(id))
      {
                case CS_TEAM_CT:
                {
                        for (loop = 1; loop <= maxplayers; loop++)
                        {
                              if (!is_user_connected(loop)) continue;
                              if (cs_get_user_team(loop) != CS_TEAM_CT) continue;
                              client_print(loop, print_chat, " %s : %s", name, test)
                        }
                }
                case CS_TEAM_T:
                {
                        for (loop = 1; loop <= maxplayers; loop++)
                        {
                              if (!is_user_connected(loop)) continue;
                              if (cs_get_user_team(loop) != CS_TEAM_T) continue;
                              client_print(loop, print_chat, " %s : %s", name, test)
                        }
                }
      }
      return PLUGIN_HANDLED
}


// 必須做的 !! 請自行修改 maxplayers 為 伺服最大人數的數值
// 本內容完全未經測試, 如有問題, 請在此貼回報
// 這是隊頻系統, 寫法只作參考, 功能未完善

tony987852 發表於 6-1-2011 23:18:49

回復 7# chantikki


    不用return任何東西嗎?

chantikki 發表於 6-1-2011 23:21:30

回復chantikki


    不用return任何東西嗎?
tony987852 發表於 6-1-2011 23:18 http://www.nakuz.com/bbs/images/common/back.gif

已修正 (在最後加入return PLUGIN_HANDLED

kining2008 發表於 10-1-2011 21:57:16

本帖最後由 kining2008 於 10-1-2011 22:00 編輯

轉唔到檔, 幫忙睇睇..
<19> error 017: undefined symbol "text"
<19> warning 215: expression has no effect
<19> error 001: expected token : ";", but found ">"
<19> error 029: invalid expression, assumed zero
<19> fatal error 107: too many error messages on one line

係我個sma第19行係e d句子:
         read_args(text,191)
參數cmd出問題?
求解答
頁: [1] 2
查看完整版本: sma一問