Raised This Month: $ Target: $400
 0% 

changing player model wo tfc_setmodel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
watch
Senior Member
Join Date: Sep 2005
Old 10-14-2005 , 18:09   changing player model wo tfc_setmodel
Reply With Quote #1

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
watch is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-14-2005 , 18:49  
Reply With Quote #2

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?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
watch
Senior Member
Join Date: Sep 2005
Old 10-14-2005 , 20:17  
Reply With Quote #3

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?
watch is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-14-2005 , 20:58  
Reply With Quote #4

It's worth a try if you can get it to work.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 10-14-2005 , 22:40  
Reply With Quote #5

Code:
#include <fakemeta>
	
engfunc(EngFunc_SetModel, id, "models/blah.mdl")
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
watch
Senior Member
Join Date: Sep 2005
Old 10-14-2005 , 22:56  
Reply With Quote #6

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
watch is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-14-2005 , 23:41  
Reply With Quote #7

Hmm, see if this works:

Code:
DispatchKeyValue(id,"replacement_model","modelName"); DispatchKeyValue(id,"replace_model_skin","skinName"); DispatchKeyValue(id,"model","modelName");
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
bahr
Member
Join Date: Aug 2005
Old 10-14-2005 , 23:49  
Reply With Quote #8

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.
bahr is offline
Send a message via MSN to bahr
watch
Senior Member
Join Date: Sep 2005
Old 12-21-2005 , 09:12  
Reply With Quote #9

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?
__________________
Code:
#include <amusing_small_signiture>
watch is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-21-2005 , 19:54  
Reply With Quote #10

Don't use anything passed 1.01.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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