Raised This Month: $ Target: $400
 0% 

make screen to 180


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 03-31-2009 , 20:04   make screen to 180
Reply With Quote #1

how can i make a screen do like a 180 turn. like lets say there lookin foward and i want them to look the other way (there back)

Last edited by whosyourdaddy; 03-31-2009 at 20:05. Reason: more descriptive title
whosyourdaddy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-31-2009 , 20:22   Re: make screen to 180
Reply With Quote #2

Change the player's angles.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 03-31-2009 , 21:03   Re: make screen to 180
Reply With Quote #3

how?
whosyourdaddy is offline
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
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-01-2009 , 13:34   Re: make screen to 180
Reply With Quote #5

Haha, can u attach a screen?`this sounds funny
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-01-2009 , 15:28   Re: make screen to 180
Reply With Quote #6

Try the code on yourself and you'll see.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-01-2009 , 16:08   Re: make screen to 180
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Try the code on yourself and you'll see.
no CS installed damn
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 04-01-2009 , 16:09   Re: make screen to 180
Reply With Quote #8

hmmm the thing is that im usin this as a code for a skill like when i attack u and it gets triggered u will look the other way.. so heres an example

im lookin at u and i shoot u, if this function gets triggered then i want u to look away from me so ur back is turned to me... this is how the function is

Code:
tornado(iAttacker,iVictim)
{
//code to make u turn ur back from me
}
think u can help me out cause i cant get anything to work
whosyourdaddy 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 02:27.


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