[原創]MyeAthena源碼教學貼: announce腳本指令強化
嚴禁轉貼!說明: 控制announce所顯示的文字大小BUILDIN_FUNC(announce)
{
const char *str, *color=NULL;
int flag, size=12;
str=script_getstr(st,2);
flag=script_getnum(st,3);
if (script_hasdata(st,4))
color=script_getstr(st,4);
+ if (script_hasdata(st,5))
+ size=script_getnum(st,5);
+ // While flag is 0x0f, the size setting won't do.
if(flag&0x0f){
struct block_list *bl=(flag&0x08)? map_id2bl(st->oid) :
(struct block_list *)script_rid2sd(st);
if( bl == NULL )
return 0;
if (color)
- clif_announce(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag);
+ {
+ if (size != 12)
+ clif_announce_ex(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag,size);
+ else
+ clif_announce(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag);
+ }
else
clif_GMmessage(bl,str,(int)strlen(str)+1,flag);
}else {
if (color)
intif_announce(str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0), flag);
else
intif_GMmessage(str,(int)strlen(str)+1,flag);
}
return 0;
} -..........-
本身EA的clif_announce函數跟上不符合@@"
clif.h
宣告int clif_announce(struct block_list *bl, const char* mes, int len, unsigned long color, int flag, int size);clif.c
int clif_announce(struct block_list* bl, const char* mes, int len, unsigned long color, int flag ,int size)
{
return clif_announce_ex(bl, mes, len, color, flag, size);
} 他分開來寫應該是有他的道理在吧:55: 3# 為私服而開
.....
結果是我看錯了=/////=
clif_announce_ex有傳入size
clif_announce則沒有. 沒有設定大小就直接預設為12
@@" #5
有什麼問題嗎? 沒有,就純粹我看錯....
他分開寫成clif_announce_ex和clif_announce的用處應該就是.........
沒有傳入大小值,就愈設為12
有什麼問題嗎?
為私服而開 發表於 2009-10-29 07:52 PM
有,看不懂 :mD148
有變字型的修改嗎 我要用別的字體 比較好看
頁:
[1]