AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Displaying viewmodel for certain amount of time (https://forums.alliedmods.net/showthread.php?t=47217)

sub 11-12-2006 11:13

Displaying viewmodel for certain amount of time
 
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.

XxAvalanchexX 11-12-2006 13:54

Re: Displaying viewmodel for certain amount of time
 
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.

sub 11-12-2006 14:00

Re: Displaying viewmodel for certain amount of time
 
yeah I know, but I have tried set task so many times, can you show me how this will be done fully?

XxAvalanchexX 11-12-2006 14:31

Re: Displaying viewmodel for certain amount of time
 
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,""); }


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

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