|
发表于 2008-12-18 20:12:44
|
显示全部楼层
|阅读模式
来自 中国–广东–佛山
- /* Plugin generated by AMXX-Studio */
-
- #include <amxmodx>
- #include <engine>
- #include <fakemeta_const>
- #include <fakemeta>
-
- new VIEW_MODEL[] = "models/v_new_awp.mdl"
- new PLAYER_MODEL[] = "models/p_new_awp.mdl"
- new WORLD_MODEL[] = "models/w_new_awp.mdl"
-
- new OLDWORLD_MODEL[] = "models/w_awp.mdl"
-
- new PLUGIN_NAME[] = "Custom Awp Model"
- new PLUGIN_AUTHOR[] = "K.K.Lv"
- new PLUGIN_VERSION[] = "1.0"
-
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
- register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
- register_forward(FM_SetModel, "fw_SetModel")
- }
-
- public plugin_precache()
- {
- precache_model(VIEW_MODEL)
- precache_model(PLAYER_MODEL)
- precache_model(WORLD_MODEL)
- }
-
- public Event_CurWeapon(id)
- {
- new weaponID = read_data(2)
- if(weaponID != CSW_AWP)
- return PLUGIN_CONTINUE
- set_pev(id, pev_viewmodel2, VIEW_MODEL)
- set_pev(id, pev_weaponmodel2, PLAYER_MODEL)
-
- return PLUGIN_CONTINUE
- }
-
- public fw_SetModel(entity, model[])
- {
- if(!is_valid_ent(entity))
- return FMRES_IGNORED
- if(!equali(model, OLDWORLD_MODEL))
- return FMRES_IGNORED
- new className[33]
- entity_get_string(entity, EV_SZ_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
- }
复制代码
上面是这个插件的源码!
是我从国外网下的,经过本人改动过的,原来是刀的模型,我把它改成AWP的!
======================
下面我就来跟大家说一下吧,可能大家一看就会懂,但是还是要说一下。
在你的cstrike\addons\amxmodx\scripting\include目录下有一个叫amxconst的文件,里面有所有武器的代码!打开看一下吧!
只要改以下的代码就行了:- new VIEW_MODEL[] = "models/v_名字.mdl"
- new PLAYER_MODEL[] = "models/p_名字.mdl"
- new WORLD_MODEL[] = "models/w_名字.mdl"
复制代码 就像我上面以AWP为例子
还要改一个:==========================================================
如果有什么问题可以与我联系,本人QQ:116268742
!!!记住!要用amxx1.8.1版的才可以编译的!!
Good Luck To You!! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|