AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Setting Player Models (https://forums.alliedmods.net/showthread.php?t=132093)

GXLZPGX 07-11-2010 19:09

Setting Player Models
 
Correct me if I'm wrong.

PHP Code:

new const gszHomerModel[] = "models/player/ignfreezetag/homer.wav"

PHP Code:

public plugin_precache( )
{
    
precache_model(gszHomerModel);


Then, in the menu, when they select homer, I use:

PHP Code:

cs_set_user_modelidgszHomerModel 

And when a new round begins

PHP Code:

cs_reset_user_modelid 

Edit: When I choose homer it crashes.

minato 07-11-2010 19:22

Re: Setting Player Models
 
It is an extension .wav not .mdl you cannot put a sound since I shape a player

PHP Code:

new const gszHomerModel[] = "models/player/ignfreezetag/homer.wav"

---->

PHP Code:

new const gszHomerModel[] = "models/player/ignfreezetag/yourmodel.mdl"


GXLZPGX 07-11-2010 19:26

Re: Setting Player Models
 
Quote:

Originally Posted by minato (Post 1235951)
It is an extension .wav not .mdl you cannot put a sound since I shape a player

PHP Code:

new const gszHomerModel[] = "models/player/ignfreezetag/homer.wav"

---->

PHP Code:

new const gszHomerModel[] = "models/player/ignfreezetag/yourmodel.mdl"


Yes I noticed that earlier when I tested it. I fixed that :) Thanks for pointing it out though. For some reason, when I choose homer, the server crashes..


Edited the post:

Alright, so I found the problem. When you set a player model up the file name in models/player has to be the same as the model. So I used:

new const gszHomerModel[] = "models/player/homer/homer.mdl";

Then I precached. Now, the server doesn't crash when I choose homer, it just doesnt set the model. I did this:

PHP Code:

cs_set_user_modelidgszHomerModel 


Kreation 07-11-2010 20:22

Re: Setting Player Models
 
Try using:

PHP Code:

cs_set_user_modelid"homer" ); 

I don't know if that will work but it should.

GXLZPGX 07-11-2010 21:06

Re: Setting Player Models
 
Quote:

Originally Posted by Kreation (Post 1236020)
Try using:

PHP Code:

cs_set_user_modelid"homer" ); 

I don't know if that will work but it should.

That worked. But look, his head is sideways and he has a knife up his ass:

http://i30.tinypic.com/33kf7o0.jpg

:/

PattyBiena 07-11-2010 21:21

Re: Setting Player Models
 
The model is wrong.

Kreation 07-11-2010 22:27

Re: Setting Player Models
 
The knife is up his ass because that's toast.. of course he has something up his ass.

ConnorMcLeod 07-12-2010 01:34

Re: Setting Player Models
 
"models/player/SAME_MODEL_NAME/SAME_MODEL_NAME.mdl"

but you obviously figured it out.

Try to find another model, that one doesn't seems to be a player model.

joropito 07-12-2010 09:26

Re: Setting Player Models
 
Quote:

Originally Posted by GXLZPGX (Post 1236088)
That worked. But look, his head is sideways and he has a knife up his ass:

http://i30.tinypic.com/33kf7o0.jpg

:/

Set pev_controller (0 to 3) to 125

But that model will have problem when you try to turn the body with the mouse.
It will turn like a "cube" and not like a human. Ok, Homer is not human :P

GXLZPGX 07-12-2010 09:31

Re: Setting Player Models
 
Quote:

Originally Posted by joropito (Post 1236591)
Set pev_controller (0 to 3) to 125

But that model will have problem when you try to turn the body with the mouse.
It will turn like a "cube" and not like a human. Ok, Homer is not human :P

set_pev( id, pev_controller, 125 )
set_pev( id, pev_controller_0, 125 )
set_pev( id, pev_controller_1, 125 )
set_pev( id, pev_controller_2, 125 )
set_pev( id, pev_controller_3, 125 )

You're saying the you wont be able to turn normally with your mouse if you choose homer?


All times are GMT -4. The time now is 07:10.

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