Raised This Month: $51 Target: $400
 12% 

Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect


Post New Thread Reply   
 
Thread Tools Display Modes
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-17-2016 , 18:43   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #21

Maybe problem is in this //#pragma semicolon 1.
You can see that I'm turn off that #pragma semicolon 1.
Reason:with that I can not compile plugin and dont know why.
Krtola is offline
Send a message via Skype™ to Krtola
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 03-17-2016 , 18:44   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #22

Quote:
Originally Posted by Krtola View Post
Maybe problem is in this //#pragma semicolon 1.
You can see that I'm turn off that #pragma semicolon 1.
Reason:with that I can not compile plugin and dont know why.
I doupt, but i will test.
Syturi0 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-17-2016 , 19:22   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #23

Quote:
Originally Posted by Syturi0 View Post
I doupt, but i will test.
Please try this version. Now change method for remove frozen and semicolon is in function
Now should work just fine.

PHP Code:
#include < amxmodx > 
#include < engine > 
#include < hamsandwich > 
#include < xs >
#include < fakemeta > 

#pragma semicolon 1 

#define PI 3.14 
#define SQRTTWO 1.41 
#define CAM_HEIGHT 18.0 
#define CAM_LIM 10.0 
#define CAM_AIMING_OFFSET 10.0 
#define CAM_CLASS "RotatingCam" 

#define CAM_SPEED 2 
#define CAM_RADIUS 50.0 

new Float:gflLauchGameTime32 ]; 
new 
Float:gflTimeToReachPosition

public 
plugin_init( ) 

        
register_plugin"Golden Eye Spawn Camera""1.0.0""Kid" );  

        
register_thinkCAM_CLASS"thinkRotatingCam" ); 
        
RegisterHamHam_Spawn"player""spawn_effect"); 
        
RegisterHamHam_Spawn"player""spawn_effect2");

        
gflTimeToReachPosition = ( ( 1.5 PI ) / ( CAM_SPEED SQRTTWO ) ); 


public 
spawn_effect2(id
{
         if(
is_user_alive(id))
         {
             
set_pevidpev_flagspevidpev_flags ) | FL_FROZEN );
         }
}

public 
spawn_effectid 

      
gflLauchGameTimeid ] = ( get_gametime( ) + gflTimeToReachPosition ); 

      new    
iEnt create_entity"info_target" ); 
      if ( 
is_valid_entiEnt ) ) 
      { 
          new 
Float:flOrigin], Float:flOffset]; 
          
flOffset] = CAM_RADIUS
          
flOffset] = CAM_HEIGHT

          
entity_set_stringiEntEV_SZ_classnameCAM_CLASS ); 
          
entity_set_modeliEnt"models/w_usp.mdl" ); 
          
entity_set_byteiEntEV_INT_solidSOLID_NOT ); 
          
entity_set_intiEntEV_INT_movetypeMOVETYPE_NOCLIP ); 
          
entity_set_edictiEntEV_ENT_ownerid ); 

          
get_offset_originidflOffsetflOrigin ); 
          
entity_set_vectoriEntEV_VEC_originflOrigin ); 
   
          
entity_set_intiEntEV_INT_rendermodekRenderTransTexture ); 
          
entity_set_floatiEntEV_FL_renderamt0.0 ); 

          
attach_viewidiEnt ); 
          
entity_set_floatiEntEV_FL_nextthinkget_gametime( ) ); 
      } 


public 
thinkRotatingCamiEnt 

    static 
iOwner
    
iOwner entity_get_edictiEntEV_ENT_owner ); 

    new 
iFlags peviOwnerpev_flags );

    if ( !
is_user_aliveiOwner ) ) 
    { 
        
remove_entityiEnt ); 
        
set_peviOwnerpev_flagsiFlags & ~FL_FROZEN );
        return 
PLUGIN_CONTINUE
    } 

    static 
Float:flOriginCamera], Float:flOriginPlayer], Float:flVelocity], Float:flAddVelocity], Float:flOffset], iHeightCheck
    
entity_get_vectoriEntEV_VEC_originflOriginCamera ); 
    
flOffset] = CAM_AIMING_OFFSET
    
get_offset_originiOwnerflOffsetflOriginPlayer ); 

    if ( 
floatsqrootfloatpower( ( flOriginPlayer] - flOriginCamera] ), 2.0 ) + floatpower( ( flOriginPlayer] - flOriginCamera] ), 2.0 ) ) <= CAM_LIM 
    { 
        
remove_entityiEnt ); 
        
attach_viewiOwneriOwner );
        
set_peviOwnerpev_flagsiFlags & ~FL_FROZEN ); 
        return 
PLUGIN_CONTINUE
    } 

    
flVelocity] = ( ( flOriginCamera] - flOriginPlayer] ) * CAM_SPEED ); 
    
flVelocity] = ( ( flOriginPlayer] - flOriginCamera] ) * CAM_SPEED ); 

    
entity_get_vectoriEntEV_VEC_velocityflAddVelocity ); 
    
flAddVelocity] = flAddVelocity] = 0.0
    if ( !( 
iHeightCheck = ( -0.25 <= ( flOriginCamera] - ( flOriginPlayer] + CAM_HEIGHT ) ) <= 0.25 ) ) && ( flAddVelocity] == 0.0 ) ) 
    { 
        
flAddVelocity] = ( ( flOriginPlayer] - flOriginCamera] ) * CAM_SPEED ); 
        
xs_vec_addflVelocityflAddVelocityflVelocity ); 
    } 
    else if ( 
iHeightCheck 
    { 
        
flVelocity] = 0.0
    } 
    
flAddVelocity] = 0.0

    if ( 
gflLauchGameTimeiOwner ] <= get_gametime( ) ) 
    { 
        
flAddVelocity] = ( ( flOriginPlayer] - flOriginCamera] ) * CAM_SPEED ); 
        
flAddVelocity] = ( ( flOriginPlayer] - flOriginCamera] ) * CAM_SPEED ); 
        
xs_vec_addflVelocityflAddVelocityflVelocity ); 
    } 

    
entity_set_vectoriEntEV_VEC_velocityflVelocity ); 

    
flOriginPlayer] += CAM_HEIGHT
    
entity_set_aimiEntflOriginCameraflOriginPlayer ); 

    
entity_set_floatiEntEV_FL_nextthinkget_gametime( ) ); 

    return 
PLUGIN_CONTINUE


/* *** GHW_Chronic's Functions *** */ 
get_offset_originiEnt, const Float:flOffset], Float:flOrigin] ) 

    if ( 
is_valid_entiEnt ) ) 
    { 
        new 
Float:flAngle]; 
        
entity_get_vectoriEntEV_VEC_originflOrigin ); 
        
entity_get_vectoriEntEV_VEC_anglesflAngle ); 

        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 
        
flOrigin] += floatsinflAngle], degrees ) * flOffset]; 

        
flOrigin] += floatsinflAngle], degrees ) * flOffset]; 
        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 

        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 
        
flOrigin] -= floatsinflAngle], degrees ) * flOffset]; 

        
flOrigin] += floatsinflAngle], degrees ) * flOffset]; 
        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 

        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 
        
flOrigin] -= floatsinflAngle], degrees ) * flOffset]; 

        
flOrigin] += floatcosflAngle], degrees ) * flOffset]; 
        
flOrigin] -= floatsinflAngle], degrees ) * flOffset]; 

        
flOrigin] -= flOffset]; 
        
flOrigin] -= flOffset]; 
        
flOrigin] -= flOffset]; 
    } 


entity_set_aimiEnt, const Float:flEntOrigin], const Float:flOrigin2] ) 

    if ( 
is_valid_entiEnt ) ) 
    { 
        static 
Float:flOrigin], Float:flVectorLengthFloat:flAimVector], Float:flNewAngles]; 

        
flOrigin] = flOrigin2]; 
        
flOrigin] = flOrigin2]; 
        
flOrigin] = flOrigin2]; 

        
flOrigin] -= flEntOrigin]; 
        
flOrigin] -= flEntOrigin]; 
        
flOrigin] -= flEntOrigin]; 

        
flVectorLength vector_lengthflOrigin ); 

        
flAimVector] = flOrigin] / flVectorLength
        
flAimVector] = flOrigin] / flVectorLength
        
flAimVector] = flOrigin] / flVectorLength

        
vector_to_angleflAimVectorflNewAngles ); 

        
flNewAngles] *= -1

        if ( 
flNewAngles] > 180.0 
        { 
            
flNewAngles] -= 360
        } 
        if ( 
flNewAngles] < -180.0 
        { 
            
flNewAngles] += 360
        } 
        if ( 
flNewAngles] == 180.0 || flNewAngles] == -180.0 
        { 
            
flNewAngles] = -179.999999
        } 

        
entity_set_vectoriEntEV_VEC_anglesflNewAngles ); 
        
entity_set_intiEntEV_INT_fixangle); 
    } 

/* ******************************* */ 

Last edited by Krtola; 03-18-2016 at 05:03.
Krtola is offline
Send a message via Skype™ to Krtola
CHE4TER
Member
Join Date: Jul 2013
Location: Portugal
Old 03-18-2016 , 13:17   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #24

Looks good, but i think it would be better if you block mouse and movements while it rotates.
Also try to create a func to hide crosshair while rotating.
CHE4TER is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-18-2016 , 18:12   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #25

Quote:
Originally Posted by CHE4TER View Post
Looks good, but i think it would be better if you block mouse and movements while it rotates.
Also try to create a func to hide crosshair while rotating.
As far as I know this is the only way to block mouse movements.
Hide crosshair is easy.
My last version works perfectly,no crash after a whole day of testing.
Krtola is offline
Send a message via Skype™ to Krtola
Old 03-18-2016, 19:25
Syturi0
This message has been deleted by Syturi0.
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-19-2016 , 08:32   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #26

Quote:
Originally Posted by Syturi0 View Post
Still crashs my server.

EDIT: It conflicts with AGuard module, thats why it is crashing. Also, the spin/camera-rotation is wierd and non-smooth.
For me works fine. No crash and spin/rotation is also ok.
Krtola is offline
Send a message via Skype™ to Krtola
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 03-19-2016 , 12:04   Re: Spawn view effect 1.0.0 - Golden Eye 64 like spawn view effect
Reply With Quote #27

Quote:
Originally Posted by Krtola View Post
For me works fine. No crash and spin/rotation is also ok.
I made my own version.
It now works properly, thanks anyways

Last edited by Syturi0; 03-30-2016 at 03:51.
Syturi0 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 12:24.


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