找回密碼
 註冊
查看: 1776|回復: 13
打印 上一主題 下一主題
收起左側

sma一問

   關閉 [複製鏈接]
跳轉到指定樓層
1#
發表於 6-1-2011 13:12:56 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
迎來我自己寫緊1個說話系統, 但係我有d野唔係幾明..
公開頻道叫做CS_TEAM_UNASSIGNED同埋cs_get_user_team(id)
旁觀者叫做CS_TEAM_SPECTATOR
咁死亡果陣時講野既原碼係咩??
仲有, 組別說話時既原碼都咩??

求高手幫幫手..我唔識
回復

使用道具 舉報

2#
發表於 6-1-2011 14:24:18 | 只看該作者
register_clcmd("say_team","function")

if(!is_user_alive(id))
{
     code...
}
回復 支持 反對

使用道具 舉報

3#
發表於 6-1-2011 17:07:02 | 只看該作者
樓上...不如成個sma寫出黎;P
回復 支持 反對

使用道具 舉報

4#
 樓主| 發表於 6-1-2011 19:00:35 | 只看該作者
仲係唔得...
error 035: argument type mismatch <argument 3>
應該點修正?
回復 支持 反對

使用道具 舉報

5#
發表於 6-1-2011 21:26:39 | 只看該作者
睇下第幾行出錯
回復 支持 反對

使用道具 舉報

6#
 樓主| 發表於 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本身已加,,
回復 支持 反對

使用道具 舉報

7#
發表於 6-1-2011 22:59:36 | 只看該作者
本帖最後由 chantikki 於 6-1-2011 23:21 編輯

register_clcmd("say_team","function_name")

public function_name(id)
{
        new name[33]
        new test[192]
        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, "[CT隊頻] %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, "[T隊頻] %s : %s", name, test)
                        }
                }
        }
        return PLUGIN_HANDLED
}


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

使用道具 舉報

8#
發表於 6-1-2011 23:18:49 | 只看該作者
回復 7# chantikki


    不用return任何東西嗎?
回復 支持 反對

使用道具 舉報

9#
發表於 6-1-2011 23:21:30 | 只看該作者
回復  chantikki


    不用return任何東西嗎?
tony987852 發表於 6-1-2011 23:18


已修正 (在最後加入return PLUGIN_HANDLED
回復 支持 反對

使用道具 舉報

10#
 樓主| 發表於 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出問題?
求解答
回復 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

快速回復 返回頂部 返回列表