Raised This Month: $ Target: $400
 0% 

Displaying viewmodel for certain amount of time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sub
Senior Member
Join Date: Nov 2004
Location: Morristown, New Jersey
Old 11-12-2006 , 11:13   Displaying viewmodel for certain amount of time
Reply With Quote #1

I would liek to display a view model for a certain time (a v_model). Like lets say when a player says /ak47, it would just use ez_set_string to display the ak47 model and no more for 5 seconds, then it would go away.
__________________
[img]http://img409.**************/img409/1079/sublimefd6.png[/img]
I Have Owned City14 - City17 - Zackscity
sub is offline
Send a message via AIM to sub Send a message via MSN to sub
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-12-2006 , 13:54   Re: Displaying viewmodel for certain amount of time
Reply With Quote #2

To set the view model:

Code:
entity_set_string(id,EV_SZ_viewmodel,"models/v_ak47.mdl");

Then use set_task for your delay. An empty string should show no model at all.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
sub
Senior Member
Join Date: Nov 2004
Location: Morristown, New Jersey
Old 11-12-2006 , 14:00   Re: Displaying viewmodel for certain amount of time
Reply With Quote #3

yeah I know, but I have tried set task so many times, can you show me how this will be done fully?
__________________
[img]http://img409.**************/img409/1079/sublimefd6.png[/img]
I Have Owned City14 - City17 - Zackscity
sub is offline
Send a message via AIM to sub Send a message via MSN to sub
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-12-2006 , 14:31   Re: Displaying viewmodel for certain amount of time
Reply With Quote #4

Code:
public myFunc(id) {      entity_set_string(id,EV_SZ_viewmodel,"models/v_ak47.mdl");      set_task(5.0,"end_myFunc",id); } public end_myFunc(id) {      entity_set_string(id,EV_SZ_viewmodel,""); }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 07:01.


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