|
楼主 |
发表于 2008-10-11 00:10:04
|
显示全部楼层
来自 中国–广西–百色–右江区
回复: ( 哎 呀 , 帮 帮 忙 好 不 好 ? ) ...有图...
Post by jim_yang
- #include <amxmodx>
- #include <hamsandwich>
- #include <cstrike>
-
- new const MODEL_t[] = "aaa"
- new const MODEL_ct[] = "bbb"
- public plugin_precache(id)
- {
- new szFile[64]
- formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", MODEL_t, MODEL_t)
- if( file_exists(szFile) )
- {
- precache_model(szFile)
- }
- formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", MODEL_ct, MODEL_ct)
- if( file_exists(szFile) )
- {
- precache_model(szFile)
- }
- }
- public plugin_init()
- {
- register_forward(FM_SetClientKeyValue, "SetClientKeyValue")
- RegisterHam(Ham_Spawn, "player", "Spawn", 1)
- }
-
- public Spawn(id)
- {
- if( is_user_alive(id) )
- {
- if( cs_get_user_team(id) == CS_TEAM_T)
- set_user_info(id, "model", MODEL_t)
- else
- set_user_info(id, "model", MODEL_ct)
- }
- }
- public SetClientKeyValue(id, infobuffer[], key[], value[])
- {
- if(equal(key, "model") && (!equal(value, MODEL_t) || !equal(value, MODEL_ct)))
- {
- if( cs_get_user_team(id) == CS_TEAM_T)
- set_user_info(id, "model", MODEL_t)
- else
- set_user_info(id, "model", MODEL_ct)
- return FMRES_SUPERCEDE
- }
- return FMRES_IGNORED
- }
复制代码 顺手改的,没测试过,需要ham 老师.........有1个未定义register_forward?已放hamsandwich模块...........
或是麻烦帮编译一下(也可能编译器问题):模型路经是:
models/player/mm_te/mm_te.mdl //土匪
models/player/hr_ct/hr_ct.mdl //警察 |
|