AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Setting custom model (https://forums.alliedmods.net/showthread.php?t=93273)

moosewanted 05-26-2009 21:34

Setting custom model
 
Hey, I am using this stock I found in a tutorial.
PHP Code:

stock fm_set_user_modelplayer, const modelname[] )
{
    
// Set new model
    
engfuncEngFunc_SetClientKeyValueplayerengfuncEngFunc_GetInfoKeyBufferplayer ), "model"modelname )
    
    
// Remember this player has a custom model
    
g_has_custom_model[player] = true


what should modelname be? for example, should it be "models/player/custom.mdl"

Thanks.

Hunter-Digital 05-26-2009 23:19

Re: Setting custom model
 
Model should be the model's name...
ex:
filename: models/player/custom/custom.mdl
modelname: custom

you need the filename to precache it and the name to use it
also, the filename format is REQUIRED, you can't use other models from other folders, only from "player" folder with the aproppiate folder for each model (gign folder for gign.mdl, custom folder for custom.mdl, etc)

moosewanted 05-27-2009 13:12

Re: Setting custom model
 
Quote:

Originally Posted by Hunter-Digital (Post 835447)
Model should be the model's name...
ex:
filename: models/player/custom/custom.mdl
modelname: custom

you need the filename to precache it and the name to use it
also, the filename format is REQUIRED, you can't use other models from other folders, only from "player" folder with the aproppiate folder for each model (gign folder for gign.mdl, custom folder for custom.mdl, etc)

No wonder it wasn't working. It has to be a model from the /player/ folder? How would I go about setting the model using a model already in half-life on a player if it isn't in the /player/ folder, the chickenmod way?

ot_207 05-27-2009 14:14

Re: Setting custom model
 
The player model needs to respect this format (when we talk about target):
PHP Code:

"models/player/NAME/NAME.mdl" 

So yes it needs to be in the player folder!

To set it use this as the string argument:
PHP Code:

"NAME" 

And about the model on half-life that is in player folder in valve it is possible but I don't know (without model precache!)!


All times are GMT -4. The time now is 01:27.

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