26 12
發新話題
打印

投票轉圖 apple_W pls come 幫我解決第二頁問題唔該

[Close]

投票轉圖 apple_W pls come 幫我解決第二頁問題唔該

我想問個有冇投票轉非官网圖嘅插件,插件名係咩?

個插件一定要共用,唔好淨係比admin用

[ 本帖最後由 wai312312 於 2011-7-17 22:50 編輯 ]
imgD:\01.gif/img

TOP

複製內容到剪貼板
代碼:
new Handle:g_MapMenu = INVALID_HANDLE

public OnPluginStart()
{
        RegConsoleCmd("menu_changemap", Command_ChangeMap);
}

public OnMapStart()
{
        g_MapMenu = BuildMapMenu();
}

public OnMapEnd()
{
        if (g_MapMenu != INVALID_HANDLE)
        {
                CloseHandle(g_MapMenu);
                g_MapMenu = INVALID_HANDLE;
        }
}

Handle:BuildMapMenu()
{
        /* Open the file */
        new Handle:file = OpenFile("maplist.txt", "rt");
        if (file == INVALID_HANDLE)
        {
                return INVALID_HANDLE;
        }

        /* Create the menu Handle */
        new Handle:menu = CreateMenu(Menu_ChangeMap);
        new String:mapname[255];
        while (!IsEndOfFile(file) && ReadFileLine(file, mapname, sizeof(mapname)))
        {
                if (mapname[0] == ';' || !IsCharAlpha(mapname[0]))
                {
                        continue;
                }
                /* Cut off the name at any whitespace */
                new len = strlen(mapname);
                for (new i=0; i<len; i++)
                {
                        if (IsCharSpace(mapname[i]))
                        {
                                mapname[i] = '\0';
                                break;
                        }
                }
                /* Check if the map is valid */
                if (!IsMapValid(mapname))
                {
                        continue;
                }
                /* Add it to the menu */
                AddMenuItem(menu, mapname, mapname);
        }
        /* Make sure we close the file! */
        CloseHandle(file);

        /* Finally, set the title */
        SetMenuTitle(menu, "Please select a map:");

        return menu;
}

public Menu_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
{
        if (action == MenuAction_Select)
        {
                new String:info[32];

                /* Get item info */
                new bool:found = GetMenuItem(menu, param2, info, sizeof(info));

                /* Tell the client */
                PrintToConsole(param1, "You selected item: %d (found? %d info: %s)", param2, found, info);

                /* Change the map */
                ServerCommand("changelevel %s", info);
        }
}

public Action:Command_ChangeMap(client, args)
{
        if (g_MapMenu == INVALID_HANDLE)
        {
                PrintToConsole(client, "The maplist.txt file was not found!");
                return Plugin_Handled;
        }       

        DisplayMenu(g_MapMenu, client, MENU_TIME_FOREVER);

        return Plugin_Handled;
}

TOP

回復 2# 的帖子

放落去邊
同埋点用,係5係禁esc再投票就ok?
上面個d洗5洗改d野,可5可以用紅字,咁樣睇好易睇d

[ 本帖最後由 wai312312 於 2011-7-17 21:37 編輯 ]
imgD:\01.gif/img

TOP

引用:
原帖由 wai312312 於 2011-7-17 12:25 發表
放落去邊
同埋点用,係5係禁esc再投票就ok?
上面個d洗5洗改d野,可5可以用紅字同中文,咁樣睇好易睇d
1.插件代碼泥
2. 禁esc就投票?are you crazy?定係電腦白癡?
3.中文?代碼用中文!!!????

TOP

回復 4# 的帖子

i is 電腦白癡泥
help help我
imgD:\01.gif/img

TOP

回復 5# 的帖子

個堆碼你咪當sp檔用囉
之後轉smx

TOP

回復 6# 的帖子

即係將其他sp檔複製再將堆碼放入去再轉smx就ok?
imgD:\01.gif/img

TOP

(mapname)打圖個名??
imgD:\01.gif/img

TOP

回復 7# 的帖子

複製左個sp檔之後clean哂入面的內容刊貼堆碼上去
跟著改名save成sp檔
最後轉smx

TOP

(mapname)打圖個名??
同入game禁咩制轉圖
imgD:\01.gif/img

TOP

回復 10# 的帖子

應該係,你試下入game睇下得唔得

TOP

入game禁咩制轉圖
imgD:\01.gif/img

TOP

回復 12# 的帖子

應該係
"map"  "地圖個名"

TOP

回復 13# 的帖子

即係"map再打地圖名"
例:"mapabc" abc=地圖名
imgD:\01.gif/img

TOP

回復 14# 的帖子

唔係呀
例如個圖叫z123

咁你要打
map  z123

TOP

 26 12
發新話題