帮忙修改一下
public client_putinserver(id){
new Name
get_user_name(id,Name,31)
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
client_print(0,print_chat,"%s来了",Name)
}else if(get_user_flags(id)&ADMIN_RESERVATION){
client_print(0,print_chat,"%s来了",Name)
}
}
=============================
谁能帮我修改 玩家进来的时候 名字是蓝色字体?
如圖...
http://img380.imageshack.us/img380/4884/showipro3tw3.gif
回复: 帮忙修改一下
public client_putinserver(id)
{
set_task(6.0,"show_client",id)
}
public client_color(playerid, colorid, msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
public show_client(id)
{
new Name,SayMsg
get_user_name(id,Name,31)
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
formatex(SayMsg,63,"^x04^x03%s^x01来了",Name)
}else if(get_user_flags(id)&ADMIN_RESERVATION){
formatex(SayMsg,63,"^x04^x03%s^x01来了",Name)
}
client_color(0,id,SayMsg)
}
回复: 帮忙修改一下
提供一下原码#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "admin"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
}
public client_putinserver(id)
{
new Name
get_user_name(id,Name,31)
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
client_print(0,print_chat,"%s来了",Name)
}else if(get_user_flags(id)&ADMIN_RESERVATION){
client_print(0,print_chat,"%s来了",Name)
}
}
可以再请这位大哥帮我修改一下
因为按照我图片上的服务器 好像可以判断 玩家选择队伍按下后才会显示 xxx 来了
并且可以判断玩家加入的是CT或者是TS 例如加入CT的玩家是蓝色字体 加入TS的是红色字体
不晓得这样有办法吗?
回复: 帮忙修改一下
测试成功 很满意 谢谢回复: 帮忙修改一下
不过刚刚有发现一个问题 不知道有谁能帮解决一下就是当我自定义
formatex(SayMsg,63,"^x04^x03%s^x01来了",Name)
"来了"的后面如果加上太多文字 当名字过长 会将后面文字吃掉
不知道有没有办法可以解决?
回复: 帮忙修改一下
Post by 6016不过刚刚有发现一个问题 不知道有谁能帮解决一下
就是当我自定义
formatex(SayMsg,512,"^x04^x03%s^x01来了",Name)
回复: 帮忙修改一下
SayMsg[64]改为SayMsg]
formatex(SayMsg,63
改成
formatex(SayMsg,127
回复: 帮忙修改一下
感谢楼上两位大哥帮小弟解答回复: 帮忙修改一下
要记得使用帖子里的感谢贴.回复: 帮忙修改一下
Post by zwfgdlcpublic client_putinserver(id)
{
set_task(6.0,"show_client",id)
}
public client_color(playerid, colorid, msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
public show_client(id)
...
第一次看到formatex(),没怎么看明白copy back。。。。
formatex
[ Main ] [ Core ] [ string.inc ]
[ comments ]
formatex - Same as format(), except does not perform a "copy back" check.
Syntax:
formatex ( output[] ,len ,const format[] , {Float,Sql,Result,_}:... )
Type:
Native
Notes:
Same as format(), except does not perform a "copy back" check.
This means formatex() is faster, but DOES NOT ALLOW this type of call:
formatex(buffer, len, "%s", buffer)
formatex(buffer, len, buffer, buffer)
formatex(buffer, len, "%s", buffer)
This is because the output is directly stored into "buffer", rather than copied back at the end.
页:
[1]
2