zhangsheng 发表于 2005-9-20 22:26:59

请问滚动字,怎么设置在中间显示?

我只改过彩色字,滚动字不是很熟,大家帮我看下,哪个地方是改中间显示的.还有滚动字开服务器60秒钟以后才能出来显示,能不能开服务器10秒中以后出来.谢谢 :boss::rolleyes:
/* AMX Mod script.
*
* (c) 2003, OLO
* This file is provided as is (no warranties).
*
* Server command:
* amx_scrollmsg <msg> <freq. in sec.>
*/

#include <amxmod>
#include <amxmisc>

#define SPEED 0.3

new g_startPos
new g_endPos
new g_scrollMsg
new g_displayMsg
new Float:g_xPos
new g_Length
new g_Frequency

public plugin_init(){
register_plugin("Scrolling Message","0.9","default")
register_srvcmd("amx_scrollmsg","setMessage")
}

public showMsg(){
new a = g_startPos, i = 0

while( a < g_endPos )
    g_displayMsg = g_scrollMsg
   
g_displayMsg = 0

if (g_endPos < g_Length)
    g_endPos++
   
if (g_xPos > 0.35)
    g_xPos -= 0.0063
else
{
    g_startPos++
    g_xPos = 0.35
}

set_hudmessage(200, 100, 0, g_xPos, 0.90, 0, SPEED, SPEED, 0.05, 0.05, 2)
show_hudmessage(0,g_displayMsg)
}

public msgInit(){
g_endPos = 1
g_startPos = 0
g_xPos = 0.65
set_task( SPEED , "showMsg",123,"",0,"a", g_Length + 48)
client_print(0,print_console,g_scrollMsg)
}

public setMessage(id,level,cid) {
if (!cmd_access(id,level,cid,3))
    return PLUGIN_HANDLED
remove_task(123) /* remove current messaging */
read_argv(1,g_scrollMsg,380)
new hostname
get_cvar_string("hostname",hostname,63)
replace(g_scrollMsg,380,"%hostname%",hostname)
g_Length = strlen(g_scrollMsg)
new mytime
read_argv(2,mytime,31)
g_Frequency = strtonum(mytime)
if (g_Frequency > 0) {   
    new minimal = floatround((g_Length + 48) * (SPEED + 0.1))
    if (g_Frequency < minimal){
      console_print(id,"Minimal frequency for this message is %d seconds",minimal)
      g_Frequency = minimal
    }
    console_print(id,"Scrolling message displaying frequency: %d:%02d minutes",
      g_Frequency/60,g_Frequency%60)
    set_task(float(g_Frequency),"msgInit",123,"",0,"b")
}
else
    console_print(id,"Scrolling message disabled")
return PLUGIN_HANDLED
}

undoer 发表于 2005-9-21 23:31:41

回复: 请问滚动字,怎么设置在中间显示?

1、如果将“滚动信息”显示在中间,将会与其它提示信息产生交错;
2、10秒钟就显示“滚动信息”的频率太快了,没等一条信息显示完,下一条又开始。

amx_scrollmsg <msg> <freq. in sec.>
         命令要滚动的信息频率:单位是秒

set_hudmessage(200, 100, 0, g_xPos, 0.90, 0, SPEED, SPEED, 0.05, 0.05, 2)
要显示信息的坐标位。

AE86 发表于 2005-9-21 23:46:13

回复: 请问滚动字,怎么设置在中间显示?

信息插件还是undoer比较懂些,每次都是你来解决。3Q了 :D

zhangsheng 发表于 2005-9-22 00:09:33

回复: 请问滚动字,怎么设置在中间显示?

undoer谢谢,最近好久没见你上点通了啊 :boss:

undoer 发表于 2005-9-23 00:14:00

回复: 请问滚动字,怎么设置在中间显示?

只是略懂一皮毛。。。。。。。。


天天都来呀。只是水平有限,无法解答问题。:D

hzhz020262 发表于 2011-7-19 18:50:49

SHD.
r.g.b.x.y.模式.显示规律4个数据。频道。全部显示都在这
页: [1]
查看完整版本: 请问滚动字,怎么设置在中间显示?