發新話題
打印

自制 Source mode 廣告插件 (完成)

[Close]

自制 Source mode 廣告插件 (完成)

冇個插件好用...DIY




只係try 出黎
如有錯請指教
引用:

#include <sourcemod>

#define PLUGIN_VERSION "0.01"
public Plugin:myinfo =
{
name = "Pllugin name",
author = "Your name",
description = "Description",
version = PLUGIN_VERSION,
url = "your url"
};

//  main programme 開始la
public OnPluginStart()
{
PrintToChatAll("   Your message here  ");  //  Print to chat box
PrintHintTextToAll("  Your message here    "); //Print to Hints box
}
1. 用EmEditor  open new file, save as your_file_name.sp
2. 放入c:\\programme file\steam\left 4 dead\left4dead\addons\sourcemod\scripting
3. 用 compile.exe
4. 由scripting\compiled拿出     your_file_name.smx  放入c:\\programme file\steam\left 4 dead\left4dead\addons\sourcemod\plugin
5. change map or reopen server

請用EmEditor , 不要用notepad....


by. 喪屍獵人>>| 天道總司

[ 本帖最後由 dreaming 於 2009-5-29 18:03 編輯 ]

TOP

Source mode 仲有其它Funtion print message


PrintToChat
PrintToChatAll
PrintCenterText
PrintCenterTextAll
PrintHintText
PrintHintTextToAll
PrintToServer
PrintToConsole

請到http://docs.sourcemod.net/api/ 查詢其用法


-----------------------------------------------------------------------------------------
PrintToChatAll  可用color

\x01
\x02
\x03
\x04
\x05
\x06
\x07
\x08
\x09
p.s. 好似\x07,8,9 用唔到    


Example: PrintToChatAll("\x01Some Color Text\nline 2");

\n = 換行

[ 本帖最後由 dreaming 於 2009-5-29 17:00 編輯 ]
附件: 您所在的用戶組無法下載或查看附件

TOP

TImer

single message
引用:
[code]
#include <sourcemod>

#define PLUGIN_VERSION "0.01"
public Plugin:myinfo =
{
name = "llugin name",
author = "Your name",
description = "Description",
version = PLUGIN_VERSION,
url = "your url"
};

//  main programme 開始la
public OnPluginStart()
{
CreateTimer(45.0, PrintMsg, _,TIMER_REPEAT);   // repeat to < wait 45 seconds, then do PrintMsg1 >
}

public ActionrintMsg1(Handle:timer)
{
        PrintHintTextToAll("            ");
        PrintHintTextToAll("         ");
//        .........
}
多message
引用:
#include <sourcemod>

#define PLUGIN_VERSION "0.01"
public Plugin:myinfo =
{
name = "llugin name",
author = "Your name",
description = "Description",
version = PLUGIN_VERSION,
url = "your url"
};

//  main programme 開始la
public OnPluginStart()
{
CreateTimer(45.0, PrintMsg1);   // wait 45 seconds, then do PrintMsg1
}

public ActionrintMsg1(Handle:timer)
{
        PrintHintTextToAll("            ");
        PrintHintTextToAll("         ");
//        .........
        CreateTimer(45.0, PrintMsg2);   // wait 45 seconds, then do PrintMsg2

}

public ActionrintMsg2(Handle:timer)
{
        PrintHintTextToAll("         ");
        PrintHintTextToAll("         ");
//        .....
        CreateTimer(45.0, PrintMsg1);   // wait 45 seconds, then do PrintMsg1
}
呢個會不停  wait 45s---->rintMsg1----->wait 45s ----> PrintMsg2

可能個methods 蠢咗D.......

[ 本帖最後由 dreaming 於 2009-5-29 17:55 編輯 ]
附件: 您所在的用戶組無法下載或查看附件

TOP

這些是應用在"OnPluginStart()"
咁唔方使.不如用SM-ADS

[ 本帖最後由 tom1314 於 2009-5-29 18:36 編輯 ]

TOP

引用:
原帖由 tom1314 於 2009-5-29 17:18 發表
這些是應用在"OnPluginStart()"
咁唔方使.不如用
我只識放1個Message

[ 本帖最後由 洛晴 於 2009-5-31 20:43 編輯 ]

TOP

發新話題