AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Modelchange for X-Time. (https://forums.alliedmods.net/showthread.php?t=92118)

pedobear 05-10-2009 11:54

Modelchange for X-Time.
 
I've got a Problem with my Shopmenu Plugin.

In the Plugin you can buy Gravity per Menu that lasts for X time.

What i want to do is now in the time the Player got the Gravity his Playermodel will be changed to another one.

My Problem is now (im not good in doing Plugins :( ) :

I tried it with:

entity_set_string(id, EV_SZ_viewmodel, "models/hat/angel2.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/hat/angel2.mdl");

and the model will be changed when i buy the Gravity now, but it will be changed also when i change the Weapon. I also dont know the function to change the Playermodel to the Standart.

Hope you can help me Guys, i've used the Search-Function so many times and i dont know how to do this.

Thank you.

----

pedobear:wink:

Arkshine 05-10-2009 13:03

Re: Modelchange for X-Time.
 
To change a player's model, you have to use cs_set_user_model(). To add a hat, see the method is this plugin.

pedobear 05-11-2009 08:30

Re: Modelchange for X-Time.
 
I'll try to do this. Answering soon.

pedobear 05-11-2009 08:35

Re: Modelchange for X-Time.
 
You said i could do it with the method of the hat plugin, but that dont include cstrike, so they dont use cs_set_user_model() ?

*confused* :o

Arkshine 05-11-2009 08:39

Re: Modelchange for X-Time.
 
Your initial post is confused too. You're talking about player's model and you give hat model as example.

That's why I said if you want to change a player's model you have to use cs_set_user_model(). If you want to add only a hat ( which is not a player's model, but just a model which will be on the player's head ), see this plugin.

pedobear 05-11-2009 08:42

Re: Modelchange for X-Time.
 
oh, ok :). The Problem is just, there are so many functions, can you give me a clue to find the solution? :oops:

Arkshine 05-11-2009 08:51

Re: Modelchange for X-Time.
 
To attach a hat you need only :

Code:
new Hat = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) ); engfunc( EngFunc_SetModel, Hat, "models/YourHatModel.mdl" ) set_pev( Hat, pev_movetype, MOVETYPE_FOLLOW ); set_pev( Hat, pev_aiment, PlayerId );

pedobear 05-11-2009 09:28

Re: Modelchange for X-Time.
 
Excellent IT WORKS! =). +Karma =).

But my last problem is now to remove the HAT, that the player get the standart model back without the Hat.

Do you know the Function :o?

Thank you very much by the way. :)

Arkshine 05-11-2009 10:03

Re: Modelchange for X-Time.
 
To remove the hat, just remove the entity. engfunc( EngFunc_RemoveEntity, Hat );

pedobear 05-11-2009 10:24

Re: Modelchange for X-Time.
 
Thank you very much =).

Now that Part has been finished.

Im now trying to do this:

At first, an IF-Function that makes the Player invisible when hes not moving.

The 2nd, an IF-Function that only CT's can buy the item.

I know how to make players invisible but ive got problems with that both IF-Functions.

Do you know that too?


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

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