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 , 22:56  
Reply With Quote #1

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
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