Raised This Month: $ Target: $400
 0% 

Solved [HELP] pev_angles Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-16-2019 , 13:50   [HELP] pev_angles Problem
Reply With Quote #1

I wanted to make a dizzy plugin. So I'm spinning the players view using pev_angles. The problem is the Y axis (players view up or down) keeps resetting to 0 and I don't know why. I'm storing all current pev_angle information in g_dizzyangle[user][0] and only editing g_dizzyangle[user][2] to spin the view. Still the Y axis keeps resetting itself. I want the player to still be able to look up or down while his world is spinning...

PHP Code:
public Dizzy(user)
{
    if(!
g_is_dizzy[user])
    {
        
g_is_dizzy[user] = true;
        
EnableHamForward(HandleDizzyPreThink[user]);
    }
    else
    {
        
g_is_dizzy[user] = false;
        
DisableHamForward(HandleDizzyPreThink[user]);
    }
}

public 
Ham_Dizzy_PreThink(user)
{
    new 
Float:g_old_angle[3];
    new 
Float:g_old_vangle[3], Float:g_vangle[3];

    
pev(userpev_anglesg_old_angle);
    
    
g_dizzyangle[user][0] = g_old_angle[0];
    
g_dizzyangle[user][1] = g_old_angle[1];

    if(
g_is_dizzy[user])
    {
        
g_dizzyangle[user][2] += 2.0;
        
set_pev(userpev_anglesg_dizzyangle[user]);
        
set_pev(userpev_fixangle1);
    }
    else
        
DisableHamForward(HandleDizzyPreThink[user]);

    return 
HAM_HANDLED

__________________

Last edited by hellmonja; 07-17-2019 at 02:54.
hellmonja is offline
 



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 17:28.


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