七、在rankd.c文件里添加以下程序,显示人物图象
Copy code
varargs string new_short( object ob ,int withshort)
{
mixed tmp;
string icon="", str;
if(!objectp(ob))
{
CHANNEL_D->do_channel(this_player(),"chat","object参数错误!");
return "";
}
if(!ob->query_temp("apply/id")||!ob->query_temp("apply/name")||!ob->query_temp("apply/short"))
str = ob->query("name") + "(" +ob->query("id") + ")" +(!withshort?"":ob->short());
else
str = ob->query_temp("apply/name")[0] + "(" +ob->query_temp("apply/id")[0] + ")" +(!withshort?"":ob->query_temp("apply/short")[0]);
if( (tmp = ob->query("icon")))
{
if( intp(tmp) )
icon = sprintf("%d",tmp);
else if( stringp(tmp) )
icon = tmp;
else
icon = "00901";
}
else
{
if(userp(ob)) icon=( ob->query("gender") == "男性" )?"1174":"1173";
else if(living(ob)) icon = "00901";
else icon = "00961";
}
while( sizeof(icon)<5 )
icon = "0" + icon;
return str + icon;
}