複製程式
new VIEW_MODELT[] = "models/[Shop]JailBreak/Punos/Punos.mdl"
new PLAYER_MODELT[] = "models/[Shop]JailBreak/Punos/Punos2.mdl"
new VIEW_MODELTGREEN[] = "models/[Shop]JailBreak/Punos/Punos_g.mdl"
new VIEW_MODELTRED[] = "models/[Shop]JailBreak/Punos/Punos_r2.mdl"
new WORLD_MODEL[] = "models/w_knife.mdl"
new OLDWORLD_MODEL[] = "models/w_knife.mdl"
public plugin_init()
{
register_event("CurWeapon", "current_weapon", "be", "1=1", "2=29")
register_forward(FM_SetModel, "fw_SetModel")
}
public plugin_precache()
{
precache_model(VIEW_MODELT)
precache_model(PLAYER_MODELT)
precache_model(VIEW_MODELTGREEN)
precache_model(VIEW_MODELTRED)
}
public current_weapon(id)
{
static CsTeams:team
new weaponID = read_data(2)
if(weaponID != CSW_KNIFE)
return PLUGIN_CONTINUE
team = cs_get_user_team(id)
switch (team)
{
case (CS_TEAM_T):
{
{
set_pev(id, pev_viewmodel2, VIEW_MODELT)
set_pev(id, pev_weaponmodel2, PLAYER_MODELT)
}
}
case(CS_TEAM_CT):
{
set_pev(id, pev_viewmodel2, VIEW_MODELCT)
set_pev(id, pev_weaponmodel2, PLAYER_MODELCT)
}
}
return PLUGIN_CONTINUE
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED
if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED
new className[33]
pev(entity, pev_classname, className, 32)
if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
engfunc(EngFunc_SetModel, entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
如果我想在10秒後,將T的刀模型換成VIEW_MODELTGREEN ;
30秒後,將T的刀的模型換成VIEW_MODELTRED
要怎麼做??
我用我的方法做,
換了其他模型, 當我在射擊時,剛好到10秒, 模型是換了,但是變成了"用刀射擊"(汗...)