AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bad Load Angles (https://forums.alliedmods.net/showthread.php?t=131324)

minato 07-03-2010 13:39

Bad Load Angles
 
Hello, good as he says the title to all on having loaded the angles the entity loads them correctly loads of side and not abreast since it was guarded

Image:
http://www.imagehost.ro/pict/032038154c2f758736778.JPG

Code:

PHP Code:

SaveOriginsid )
{
    if( 
file_existsgConfigFile ) )
        
delete_filegConfigFile );

    new 
iFile fopengConfigFile"wt" );

    if( !
iFile ) return;

    new 
Float:vOrigin], iEntity
    
new Float:iAngles]  

    while( ( 
iEntity find_ent_by_classiEntity_CLASS) ) > 
    {
        
pev(iEntitypev_originvOrigin );
        
pev(iEntitypev_anglesiAngles);
    

        
fprintfiFile"%f %f %f | Origins - %f %f %f | Angles^n"vOrigin], vOrigin], vOrigin],iAngles], iAngles], iAngles] );
    }
    
client_print(id,print_chat,"[EM] Save Succes!")
    
    
fcloseiFile );
}
LoadOrigins() 
{
    new 
iFile fopengConfigFile"rt" );

    if( !
iFile ) return;
    
    new 
Float:iAngles],ix16 ], iy16 ], iz16 ]
    new 
Float:vOrigin], x16 ], y16 ], z16 ],szDatasizeof) + sizeof) + sizeof) + sizeofix ) + sizeofiy ) + sizeofiz ) + ];
    while( !
feofiFile ) ) 
    {
        
fgetsiFileszDatacharsmaxszData ) );
        
trimszData );
        
        if( !
szData] ) continue;
        
        
parseszDatax15y15z15ix15iy15iz15);
        
vOrigin] = str_to_float);
        
vOrigin] = str_to_float);
        
vOrigin] = str_to_float);
        
iAngles] = str_to_floatix );
        
iAngles] = str_to_floatiy );
        
iAngles] = str_to_floatiz );
        
        
make_ent(vOrigin,iAngles)
        
    }
    
    
fcloseiFile );



Sylwester 07-03-2010 13:53

Re: Bad Load Angles
 
try this:
PHP Code:

SaveOriginsid )
{
    if( 
file_existsgConfigFile ) )
        
delete_filegConfigFile );

    new 
iFile fopengConfigFile"wt" );

    if( !
iFile ) return;

    new 
Float:vOrigin], iEntity
    
new Float:iAngles]  

    while( ( 
iEntity find_ent_by_classiEntity_CLASS) ) > 
    {
        
pev(iEntitypev_originvOrigin );
        
pev(iEntitypev_anglesiAngles);
    

        
fprintfiFile"%f %f %f %f %f %f^n"vOrigin], vOrigin], vOrigin],iAngles], iAngles], iAngles] );
    }
    
client_print(id,print_chat,"[EM] Save Succes!")
    
    
fcloseiFile );
}
LoadOrigins() 
{
    new 
iFile fopengConfigFile"rt" );

    if( !
iFile ) return;
    
    new 
Float:iAngles],ix16 ], iy16 ], iz16 ]
    new 
Float:vOrigin], x16 ], y16 ], z16 ],szDatasizeof) + sizeof) + sizeof) + sizeofix ) + sizeofiy ) + sizeofiz ) + ];
    while( !
feofiFile ) ) 
    {
        
fgetsiFileszDatacharsmaxszData ) );
        
trimszData );
        
        if( !
szData] ) continue;
        
        
parseszDatax15y15z15ix15iy15iz15);
        
vOrigin] = str_to_float);
        
vOrigin] = str_to_float);
        
vOrigin] = str_to_float);
        
iAngles] = str_to_floatix );
        
iAngles] = str_to_floatiy );
        
iAngles] = str_to_floatiz );
        
        
make_ent(vOrigin,iAngles)
        
    }
    
    
fcloseiFile );



minato 07-03-2010 14:33

Re: Bad Load Angles
 
Sylwester@ Thank you for your help, now it works correctly:)


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

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