搜索
查看: 2001|回复: 4

本人不才,这个代码困惑了好久!请教师傅!

[复制链接]
发表于 2007-11-10 14:13:50 | 显示全部楼层 |阅读模式 来自 中国–广西–南宁–武鸣区
如下代码:
// ------------------------------------------------------------------------------------------
// --CUSTOM MODEL LIST----------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
public get_models(array[32][],len) {
//获得名单上选择的模型get a list of custom models
new dirpos, output[64], outlen, filledamt;
// 经过选择模型go through custom models
while((dirpos = read_dir("models/player",dirpos,output,255,outlen)) != 0) {
if(containi(output,".") == -1) { // if not a file (but a directory)
// 检查是否有模型
new modelfile[64];
format(modelfile,63,"models/player/jc/%s/%s.mdl",output,output);
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
我想在检查模型那里加入判断,当为警察的时候,检查的路径为:
new modelfile[64];
format(modelfile,63,"models/player/jc/%s/%s.mdl",output,output);
--如果为土匪,检查路径为:
new modelfile[64];
format(modelfile,63,"models/player/tf/%s/%s.mdl",output,output);
不知道这个代码怎么写~望高手赐教!
发表于 2007-11-10 18:02:01 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 本人不才,这个代码困惑了好久!请教师傅!

试试
cs_get_user_team,也许可以!
回复

使用道具 举报

 楼主| 发表于 2007-11-10 18:35:14 | 显示全部楼层 来自 中国–广西–南宁–武鸣区

回复: 本人不才,这个代码困惑了好久!请教师傅!

用过了cs_get_user_team,就是不知道怎么把路径赋予它
回复

使用道具 举报

 楼主| 发表于 2007-11-10 18:35:45 | 显示全部楼层 来自 中国–广西–南宁–武鸣区

回复: 本人不才,这个代码困惑了好久!请教师傅!

谁能指点我啊?????
回复

使用道具 举报

发表于 2007-11-10 20:06:27 | 显示全部楼层 来自 中国–广东–惠州–惠城区

回复: 本人不才,这个代码困惑了好久!请教师傅!

if (get_user_team(id)==1)//等于1表示土匪,2表示警察
{
cs_set_user_model(id,"模块路径")
}
回复

使用道具 举报

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

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