搜索
查看: 3690|回复: 5

关于"show_hudmessage"里字体的位置和大小

[复制链接]
发表于 2007-12-29 20:50:43 | 显示全部楼层 |阅读模式 来自 中国–甘肃–兰州
我在CS1.6里用了这个显示玩家血甲值插件(amx_playername.amxx),但觉得里面相关信息的字体太大了,颜色也不完全一样,并且信息显示的位置也和原始的不太一样.

怎么才能够既可以用"show_hudmessage"的方式显示,又能让信息的字体大小,颜色和位置都和原始的一样呢?如果不行的话,是不是得改用"client_print"的方式显示呢?(参见截图)
[php]/**************************************************
* AMXX Script * *
* Author: Yuri * *
* Version 0.1 * * * * * * * * * * * * * *
* Look at a player and see their name. lolz *
***************************************************/
#include <amxmodx>
#include <amxmisc>
new friend[33]
public set_team(id)
friend[id] = read_data(2)
public hide_status(id){
set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
show_hudmessage(id,"")
}
public show_status(id){
new name[32],pid = read_data(2)
get_user_name(pid,name,31)
new color1 = 0,color2 = 0
if ( get_user_team(pid)==1 )
color1 = 255
else
color2 = 255
if (friend[id] == 1){ /* friend */
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
show_hudmessage(id,"队友 : %s 生命值 : %d%",name,get_user_health(pid))
}
else {
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
show_hudmessage(id,"敌人 : %s",name)
}
}
public plugin_init(){
register_plugin("Player Name","0.1","Yuri")
register_event("StatusValue","set_team","be","1=1")
register_event("StatusValue","show_status","be","1=2","2!0")
register_event("StatusValue","hide_status","be","1=1","2=0")
}[/php]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
 楼主| 发表于 2007-12-29 21:01:31 | 显示全部楼层 来自 中国–甘肃–兰州

回复: 关于&quot;show_hudmessage&quot;里字体的位置和大小

也就是说,对于显示玩家血甲值的相关信息部分,怎么才能把第一个图的效果改成和第二个图的一样.
回复

使用道具 举报

发表于 2007-12-30 08:23:05 | 显示全部楼层 来自 中国–福建–漳州

回复: 关于&quot;show_hudmessage&quot;里字体的位置和大小

HUD字体的大小,服务器是控制不了的,而是由客户端资源文件里控制的。
回复

使用道具 举报

 楼主| 发表于 2007-12-30 15:14:45 | 显示全部楼层 来自 中国–甘肃–兰州

回复: 关于&quot;show_hudmessage&quot;里字体的位置和大小

set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
client_print(id,print_center,"队友 : %s 生命值 : %d%",name,get_user_health(pid))
}
else {
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
client_print(id,print_center,"敌人 : %s",name)
版主,我把这部分的代码修改成上面的样子,编译后测试,发现字体的大小和原始的一样了,但字体的颜色却是黄色的(与控制台的颜色一样:con_color "255 255 0"),无法出现CT和T的团队颜色,怎么解决这个问题呢?
回复

使用道具 举报

发表于 2007-12-30 23:56:10 | 显示全部楼层 来自 中国–福建–漳州

回复: 关于&quot;show_hudmessage&quot;里字体的位置和大小

只显示生命值有什么意义啊?CS本来就是这么显示的。
我也不知道该怎么显示成按团队颜色。
回复

使用道具 举报

 楼主| 发表于 2007-12-31 15:17:26 | 显示全部楼层 来自 中国–甘肃–兰州

回复: 关于&quot;show_hudmessage&quot;里字体的位置和大小

再向Rulzy版主请教个问题,我们知道插件可以定义文字信息的显示方式,大体上有三种方式:
"set_hudmessage","client_print"和"format".

1.如果以"set_hudmessage"的方式显示,那么要修改信息的显示位置是很容易的,只要对坐标的数字做修改就行了.

2.如果以"client_print"的方式显示,那么要修改信息的显示位置的话,好像只有两种方法,即"print_chat"(在屏幕的左下角显示)或"print_center"(屏幕居中显示).

3.如果以"format"的方式显示,那么要修改信息的显示位置的话,我就不太清楚了,好像这种信息显示的位置是固定的,只能是屏幕的左下角.不知道有没有办法能让它的位置更改到别的地方呢?
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表