Raised This Month: $ Target: $400
 0% 

make screen to 180


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-01-2009 , 02:10   Re: make screen to 180
Reply With Quote #4

PHP Code:
/*    Copyright © 2008, ConnorMcLeod

    Migraine is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Migraine; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Migraine"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

new bool:g_bReversed[33]
new 
Float:g_flAngles[33][2]
new 
Float:g_flCVars[33][2]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_PlayerPreThink"PlayerPreThink")
    
register_clcmd("amx_reverse""AdminCommand_Reverse"ADMIN_KICK)    
}

public 
client_putinserver(id)
{
    
g_bReversed[id] = false
    set_task
(0.1"Get_CVars"id)
}

public 
Get_CVars(id)
{
    
query_client_cvar(id"m_pitch""ClientCvarResult")
    
query_client_cvar(id"m_yaw""ClientCvarResult")
}

public 
ClientCvarResult(id, const szCvar[], const szValue[])
{
    new 
Float:flValue str_to_float(szValue)

    if( 
flValue )
        
flValue = -flValue

    
switch( szCvar[2] )
    {
        case 
'p':g_flCVars[id][0] = flValue
        
case 'y':g_flCVars[id][1] = flValue
    
}

//    Restore_ClientValues(id)
// can't rememeber why i put this here
}

public 
AdminCommand_Reverse(idlevelcid)
{
    if( !
cmd_access(idlevelcid2) )
        return 
PLUGIN_HANDLED

    
new szPlayer[32]
    
read_argv(1szPlayer31)

    new 
plr cmd_target(idszPlayer, (1<<1)|(1<<3))
    if( !
plr )
        return 
PLUGIN_HANDLED

    
if( !g_bReversed[plr] )
    {
        
Inverse_ClientValues(plr)
        
g_bReversed[plr] = true
    
}
    else
    {
        
Restore_ClientValues(plr)
        
g_bReversed[plr] = false
    
}

    
g_flAngles[plr][0] = 0.0
    g_flAngles
[plr][1] = 0.0

    
return PLUGIN_HANDLED
}

Restore_ClientValues(id)
{
    
client_cmd(id"m_pitch %f"g_flCVars[id][0])
    
client_cmd(id"m_yaw %f"g_flCVars[id][1])
}

Inverse_ClientValues(id)
{
    
client_cmd(id"m_pitch %f", -g_flCVars[id][0])
    
client_cmd(id"m_yaw %f", -g_flCVars[id][1])
}

public 
PlayerPreThink(id)
{
    if(
is_user_alive(id) && g_bReversed[id])
    {
        if( 
g_flAngles[id][1] < 180.0 )
        {
            
g_flAngles[id][1] += 2.0
            g_flAngles
[id][0] = g_flAngles[id][1] * 2.0
        
}
        else
        {
            
g_flAngles[id][0] = 0.0
        
}

        static 
Float:flPAngle[3]
        
flPAngle[0] = g_flAngles[id][0]
        
flPAngle[1] = g_flAngles[id][0]
        
flPAngle[2] = g_flAngles[id][1]
        
set_pev(idpev_punchangleflPAngle)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 02:27.


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