AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Aiming vector (https://forums.alliedmods.net/showthread.php?t=64549)

USvER 12-18-2007 05:42

Aiming vector
 
I want to save and change aiming vector but something is obviously wrong...
An inversion goes at Y and -Y is lost...

PHP Code:

#include <amxmodx>
#include <fakemeta>

/////////////////////////////////////////////////////////////////////////////////////
//////////////////////GLOBALS////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

#define MAX_FRAMES 500
new demo_recording 0
new demo_playing 0
new Float:demo_data[MAX_FRAMES][3]
new 
demo_curentframe 0

/////////////////////////////////////////////////////////////////////////////////////
////////////////////////MAIN/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

public plugin_init(){
    
register_plugin("Megaplugin""0.1b""[UA] USvER")

    
register_concmd("demo_record""demo_record"ADMIN_KICK"")
    
register_concmd("demo_play""demo_play"ADMIN_KICK"")

    
register_forward(FM_StartFrame,"demo_frame"0)
}

/////////////////////////////////////////////////////////////////////////////////////

public demo_record(idlevelcid){
    if (!
demo_playing)demo_recording 1
    
return PLUGIN_HANDLED
}

/////////////////////////////////////////////////////////////////////////////////////

public demo_play(idlevelcid){
    if (!
demo_recording)demo_playing 1
    
return PLUGIN_HANDLED
}

/////////////////////////////////////////////////////////////////////////////////////

public demo_frame(){
    new 
id get_user_index("USvER")
    if(
demo_recording){
        
pev(idpev_angles,demo_data[demo_curentframe])
        ++
demo_curentframe
        
if(demo_curentframe == MAX_FRAMES){
            
demo_curentframe 0
            demo_recording 
0
        
}
    }

    if(
demo_playing){
        
set_pev(idpev_anglesdemo_data[demo_curentframe])
        
set_pev(idpev_fixangle1)
        ++
demo_curentframe


        
if(demo_curentframe == MAX_FRAMES){
            
demo_curentframe 0
            demo_playing 
0
        
}
    }

    return 
FMRES_OVERRIDE


Please explain to me these variables
pev_v_engle
pev_engles
pev_origin
pev_velocity

tnx

Zenith77 12-18-2007 18:13

Re: Aiming vector
 
The pev section in an entity is where it stores a lot of it's personal info.

pev_v_angle - viewing angles of the entity (degrees)
pev_angles - IIRC, the way they are facing (degrees)
pev_origin - its current origin in the world
pev_velocity - the speed and direction of the entity. Contains a vector (x, y, z) in a 3 dimensional array.

USvER 12-19-2007 02:22

Re: Aiming vector
 
tnx

Quote:

Originally Posted by Zenith77 (Post 564701)
pev_angles - IIRC, the way they are facing (degrees)

I still do not understand what this pev keeps.
Because when I save and load pev_v_angles it does not help.

Somebody plz help :shock: why my plugin does not work.:cry:

USvER 12-19-2007 16:18

Re: Aiming vector
 
OOOOOOOOMMMMMMMMMMMMMMGGGGGGGGGGGGGGGGGGGGGGG GGGGGG!!!!

For saving and load of aiming vector it is needed to save pev_v_angle and restore it to pev_angles

I search for it 3 days...:shock::evil:


All times are GMT -4. The time now is 11:02.

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