| closeddod_setmodel Not Working? |
| Started by Wilson [29th ID] on 04-21-2007, 12:21 AM |
Threads: 57
Joined: Oct 2005
This plugin used to work...then one day it just stopped. Around the same time I upgraded to the new version of DoDX..which makes me think maybe that is the reason.rnrnAm I somehow using this wrong, because I sware this used to work and I didn't change it. Or is it that the dodx module needs that native fixed?rnrn
rnrn#include <amxmodx>rn#include <amxmisc>rn#include <dodx>rnrn#define PLUGIN "Class A"rn#define VERSION "1.0"rn#define AUTHOR "29th ID"rnrnnew g_isClassA[33], g_bodynum[33];rnnew g_szMdl[48] = "models/player/us-classa/us-classa.mdl";rnnew g_szMdlT[48] = "models/player/us-classa/us-classaT.mdl";rnrnpublic plugin_init() {rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn register_clcmd("classa", "toggle_classa");rn}rnrnpublic plugin_precache() {rn precache_model(g_szMdl);rn precache_model(g_szMdlT);rn}rnrnpublic client_connect( id ) {rn g_isClassA[id] = 0;rn}rnrnpublic toggle_classa(id) {rn if(!g_isClassA[id])rn {rn dod_set_model(id, "us-classa");rn g_isClassA[id] = 1;rn client_print(id, print_chat, "*You are now wearing Class A");rn }rn elsern {rn dod_set_model(id, "us-inf");rn g_isClassA[id] = 0;rn client_print(id, print_chat, "*You are now wearing Field Uniform");rn }rn return PLUGIN_HANDLED;rn}rnrnrnrnWhen I execute the client command, the server crashes, and doesn't log any errors.Threads: 17
Joined: Jan 2005
This could be the problem:n ndod_set_model(id, "us-inf");ninstead of ndod_set_model(id, "us-classaT");
Threads: 57
Joined: Oct 2005
Hell Phoenix....I don't get it...I don't have that line of code with classaT in my plugin...whaaat?!
Threads: 17
Joined: Jan 2005
Your loading 2 models and only using 1 of them. Im assuming the us-inf is this model:nnew g_szMdlT[48] = "models/player/us-classa/us-classaT.mdl";n nIm saying it should be dod_set_model(id, "us-classaT");nsorry if that was confusing. Basically your loading a model you never precached by calling us-inf.
Threads: 103
Joined: May 2005
the "T" models are like submodels for the non "T" one that are kept in a seperate file...nnnalot of models in the half-life.gcf file have the normal model and then the "T" submodel... you still load the non "T" model.. but it wont load unless the "T" model is present...nnif that makes any sense
Threads: 57
Joined: Oct 2005
Without looking in the module's source code, I am pretty sure that the native sets the pdata offset of the player, which is somewhere between 100 and 800 if I remember correctly, to the string in the second parameter of the call.rnrnI remember because normally that pdata offset says "us-inf"rnrnAnd in adminmodels plugin, Zor just does dod_setmodel( id, "us-admin" ); not adminT
Threads: 54
Joined: May 2005
the "T" models are like submodels for the non "T" one that are kept in a seperate file...n n nalot of models in the half-life.gcf file have the normal model and then the "T" submodel... you still load the non "T" model.. but it wont load unless the "T" model is present...n nif that makes any sensen nmakes sense to me.. T model files are simply texture "containers" for a model ... usually only the player type models have them although some other "intricate" models may as well, and its a simple "flag" in the .qc file that determines if a model is compiled with textures included or in a seperate file. The T files, while having to have to be precached, do not need to be called upon, rather they are simply a dependency of the "main" model and will be "used" when the main one is...n nhope THAT made sense...

