AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   changing player model wo tfc_setmodel (https://forums.alliedmods.net/showthread.php?t=19343)

watch 10-14-2005 18:09

changing player model wo tfc_setmodel
 
ok basically im looking for a way of changing a player model without using tfc_setmodel

ive tried entity_set_model(id,"models/player/<modelname>/<modelname>.mdl") with no luck

just wondering if there was another method, this is for tfc btw

cheers :)

XxAvalanchexX 10-14-2005 18:49

Quote:

Originally Posted by T(+)rget
To get it working with FM you'd need to completely block ClientUserInfoChanged when model changing is occuring and also set SET_CLIENT_KEYVALUE in PlayerPostThink.

Its how it works in VexdUM, think CStrike module using pvdata offsets?


watch 10-14-2005 20:17

rito thanks ava, ill have a look into it

I was thinking about this earlier and in tfc you have item_tfgoals which have "replacement_model" which allows you to change the playermodel of the person who picks it up

http://tf.valve-erc.com/kbase.php?id=2

Do you reckon it is possible to create an item_tfgoal at the users origin and set the bitfield values of the entity corretly?

Might be easier than using FM?

XxAvalanchexX 10-14-2005 20:58

It's worth a try if you can get it to work.

noob cannon lol 10-14-2005 22:40

Code:

#include <fakemeta>
       
engfunc(EngFunc_SetModel, id, "models/blah.mdl")


watch 10-14-2005 22:56

Quote:

Originally Posted by noob cannon lol
Code:

#include <fakemeta>
       
engfunc(EngFunc_SetModel, id, "models/blah.mdl")


nope not working :(

---

Im not really sure how i would set strings like "replacement_model" on the entity i create.. if its even possible?

---

After some searching this is some code from VexdUM

http://cvs.amxmod.net/viewcvs.cgi/am...M.cpp?rev=HEAD
Quote:

// Set A TFC Player's model. This works differently then CS.
static cell AMX_NATIVE_CALL TFC_SetModel(AMX *amx, cell *params) {
int iIndex = params[1];

if (check_player(iIndex)) {
AMX_RAISEERROR(amx,AMX_ERR_NATIVE);
return 0;
}

int iLength;
char *szSkin = stringVault.put(GET_AMXSTRING(amx, params[3], 0, iLength));//AMX_GET_STRING(amx, params[3], iLength);
char *szModel = stringVault.put(GET_AMXSTRING(amx, params[2], 0, iLength));//AMX_GET_STRING(amx, params[2], iLength);

edict_t *pPlayer = INDEXENT(iIndex);

KeyValueData pkvd;
pkvd.szClassName = "player";
pkvd.szKeyName = "replacement_model";
pkvd.szValue = szModel;
pkvd.fHandled = FALSE;
(gpGamedllFuncs->dllapi_table->pfnKeyValue)(pPlayer, &pkvd);

KeyValueData pkvd2;
pkvd2.szClassName = "player";
pkvd2.szKeyName = "replacement_model_skin";
pkvd2.szValue = szSkin;
pkvd2.fHandled = FALSE;
(gpGamedllFuncs->dllapi_table->pfnKeyValue)(pPlayer, &pkvd2);

SET_CLIENT_KEYVALUE(iIndex, GET_INFO_KEYBUFFER(pPlayer), "model", szModel);

return 1;
}
im not really sure how i would go about doing what target suggested, but its too late to think now, gonna work on it in the morning

XxAvalanchexX 10-14-2005 23:41

Hmm, see if this works:

Code:
DispatchKeyValue(id,"replacement_model","modelName"); DispatchKeyValue(id,"replace_model_skin","skinName"); DispatchKeyValue(id,"model","modelName");

bahr 10-14-2005 23:49

Or you could use skinmod.dll...

But from the fgd:

Code:

        replacement_model(string) : "Replacement model"
        replacement_model_body(integer) : "Replacement model Body setting"
        replacement_model_skin(integer) : "Replacement model Skin setting"
        replacement_model_flags(choices) : "Replacement model Flags" : 0 =

Note that 'replacement_model_skin' is an integer.

watch 12-21-2005 09:12

Sorry to revive this old topic, i started to use v 1.01 meaning i could use tfc_setmodel without the bugs.

Im using 1.6 now and would prefer not to use the whole tfcx module just for 1 function.

DispatchKeyValue(id,"replacement_model","mode lName"); did work ty avalanche, the only problem is that you have to respawn for it to take effect.

Is there anyway i could make it instant?

XxAvalanchexX 12-21-2005 19:54

Don't use anything passed 1.01.


All times are GMT -4. The time now is 23:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.