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:
Code:
PHP Code:
SaveOrigins( id )
{
if( file_exists( gConfigFile ) )
delete_file( gConfigFile );
new iFile = fopen( gConfigFile, "wt" );
if( !iFile ) return;
new Float:vOrigin[ 3 ], iEntity
new Float:iAngles[ 3 ]
while( ( iEntity = find_ent_by_class( iEntity, _CLASS) ) > 0 )
{
pev(iEntity, pev_origin, vOrigin );
pev(iEntity, pev_angles, iAngles);
fprintf( iFile, "%f %f %f | Origins - %f %f %f | Angles^n", vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ],iAngles[ 0 ], iAngles[ 1 ], iAngles[ 2 ] );
}
client_print(id,print_chat,"[EM] Save Succes!")
fclose( iFile );
}
LoadOrigins()
{
new iFile = fopen( gConfigFile, "rt" );
if( !iFile ) return;
new Float:iAngles[ 3 ],ix[ 16 ], iy[ 16 ], iz[ 16 ]
new Float:vOrigin[ 3 ], x[ 16 ], y[ 16 ], z[ 16 ],szData[ sizeof( x ) + sizeof( y ) + sizeof( z ) + sizeof( ix ) + sizeof( iy ) + sizeof( iz ) + 3 ];
while( !feof( iFile ) )
{
fgets( iFile, szData, charsmax( szData ) );
trim( szData );
if( !szData[ 0 ] ) continue;
parse( szData, x, 15, y, 15, z, 15, ix, 15, iy, 15, iz, 15);
vOrigin[ 0 ] = str_to_float( x );
vOrigin[ 1 ] = str_to_float( y );
vOrigin[ 2 ] = str_to_float( z );
iAngles[ 0 ] = str_to_float( ix );
iAngles[ 1 ] = str_to_float( iy );
iAngles[ 2 ] = str_to_float( iz );
make_ent(vOrigin,iAngles)
}
fclose( iFile );
}