|
|
说明|Description:
[CN]
就是用实体全局控制(Full Pack)来直接更改实体的模型索引[] 这个方法对玩家同样有用[]
[EN]
This code changes the model index of entities by FullPack, the same goes for clients.
- #include <amxmodx>
- #include <fakemeta>
- #define PLUGIN_NAME "Set Bot Model"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "ESFKAMI"
- //Credit goes to Starman
- new fatbuu// 模型索引[] Model Index
- new bool: NewModel[33], NewModelIndex[33]
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- register_forward(FM_AddToFullPack, "fw_AddToFullPack", 1);
- register_clcmd("tt", "test")
- }
- public test(id)
- {
- esf_set_bot_model(5, fatbuu)
- }
- stock esf_set_bot_model(Bot, ModelIndex)
- {
- NewModel[Bot] = true
- NewModelIndex[Bot] = ModelIndex
- }
- public fw_AddToFullPack(Handle, Edict, Entity, Host, Flags, Player, Set)// FullPack是实体的全局控制[] Full Pack handles all of entities in the game.
- {
- if(is_user_bot(Entity) && NewModel[Entity])
- {
- set_es(Handle, ES_ModelIndex, NewModelIndex[Entity])// 给handle到的实体设置模型[] Set model to the entity which is handled.
- }
- }
- public plugin_precache()
- {
- fatbuu = precache_model("models/player/fatbuu/fatbuu.mdl")
- }
复制代码 |
|