AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   view spin 360 degres . (https://forums.alliedmods.net/showthread.php?t=76610)

grimvh2 08-27-2008 11:32

view spin 360 degres .
 
Fast question :

How can I spin someones view with 360 degres
so a that the player his view does a full turn .
Somebody knows ?

Exolent[jNr] 08-27-2008 11:43

Re: view spin 360 degres .
 
Code:
new g_yawspeed[33][6]; new Float:g_start_angle[33]; new bool:g_spinning[33]; #define SPIN_SPEED 100 public plugin_init() {     register_forward(FM_PlayerPreThink, "FwdPlayerPreThink"); } public FwdPlayerPreThink(id) {     if( g_spinning[id] )     {         new Float:angles[3];         pev(id, pev_v_angle, angles);         // cant remember if its pev_v_angle or pev_angles                 if( floatabs(angles[1] - g_start_angle[plr]) < 5.0 )         {             client_cmd(id, "-left; cl_yawspeed %s", g_yawspeed[id]);             g_spinning[id] = false;         }     } } SpinPlayer(id) {     query_client_cvar(id, "cl_yawspeed", "DoSpin"); } public DoSpin(id, const cvar_name[], const cvar_value[]) {     copy(g_yawspeed[id], sizeof(g_yawspeed[]) - 1, cvar_value);         client_cmd(id, "cl_yawspeed %i; +left", SPIN_SPEED);     //g_spinning[id] = true;         new Float:angles[3];     pev(id, pev_v_angle, angles);     // again, I can't remember which it was         g_start_angle[plr] = angles[1];         set_task(0.5, "TaskAllowStop", plr); } public TaskAllowStop(plr) {     g_spinning[plr] = true; }

Code:
public myfunction(id) {     SpinPlayer(id); // spins player for 360 degree turn }

Alka 08-27-2008 15:39

Re: view spin 360 degres .
 
Or you can add +1.0 or w/e to original angle[1] until is equal to initial one.This in case you don't want to use client_cmd()...

Hi Exolent.

EDIT:Yea, indeed.

Exolent[jNr] 08-27-2008 15:41

Re: view spin 360 degres .
 
Hi Alka! I have another way of doing it like you said, but it's not as smooth like the one I showed.

grimvh2 08-27-2008 16:28

Re: view spin 360 degres .
 
Thanks , gonna test it now .

Sorry for late reply I was footballing :D

grimvh2 08-29-2008 11:32

Re: view spin 360 degres .
 
Well I tested it and it doesnt stop with spinning , also is there a way to make it faster ?

[X]-RayCat 08-29-2008 13:50

Re: view spin 360 degres .
 
you must set the yawspeed higher. :)

Exolent[jNr] 08-29-2008 15:48

Re: view spin 360 degres .
 
Changed the plugin a bit, highlighted lines changed.

grimvh2 08-29-2008 16:27

Re: view spin 360 degres .
 
Quote:

Originally Posted by Exolent[jNr] (Post 678051)
Changed the plugin a bit, highlighted lines changed.

Thanks again , ill test it .


All times are GMT -4. The time now is 03:18.

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