Raised This Month: $ Target: $400
 0% 

Modelchange for X-Time.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pedobear
Junior Member
Join Date: May 2009
Old 05-10-2009 , 11:54   Modelchange for X-Time.
Reply With Quote #1

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
pedobear is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-10-2009 , 13:03   Re: Modelchange for X-Time.
Reply With Quote #2

To change a player's model, you have to use cs_set_user_model(). To add a hat, see the method is this plugin.
Arkshine is offline
pedobear
Junior Member
Join Date: May 2009
Old 05-11-2009 , 08:30   Re: Modelchange for X-Time.
Reply With Quote #3

I'll try to do this. Answering soon.
pedobear is offline
pedobear
Junior Member
Join Date: May 2009
Old 05-11-2009 , 08:35   Re: Modelchange for X-Time.
Reply With Quote #4

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*
pedobear is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2009 , 08:39   Re: Modelchange for X-Time.
Reply With Quote #5

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.
Arkshine is offline
pedobear
Junior Member
Join Date: May 2009
Old 05-11-2009 , 08:42   Re: Modelchange for X-Time.
Reply With Quote #6

oh, ok . The Problem is just, there are so many functions, can you give me a clue to find the solution?
pedobear is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2009 , 08:51   Re: Modelchange for X-Time.
Reply With Quote #7

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

Last edited by Arkshine; 05-11-2009 at 09:07.
Arkshine is offline
pedobear
Junior Member
Join Date: May 2009
Old 05-11-2009 , 09:28   Re: Modelchange for X-Time.
Reply With Quote #8

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 ?

Thank you very much by the way.
pedobear is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2009 , 10:03   Re: Modelchange for X-Time.
Reply With Quote #9

To remove the hat, just remove the entity. engfunc( EngFunc_RemoveEntity, Hat );
Arkshine is offline
pedobear
Junior Member
Join Date: May 2009
Old 05-11-2009 , 10:24   Re: Modelchange for X-Time.
Reply With Quote #10

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?
pedobear 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 01:24.


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