Thread: Rotating?
View Single Post
  #28  
Old 01-18-2008, 05:36 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
there is another car script i found, and it does gani, but it shows the car under you not rotating, but the direction is right. this was by chris.
PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if ( 
player.chat == ":car" )
  {
    
this.car = 1 - this.car;
    if ( 
this.car )
    {
      
client.frozen = true;
      
setTimer( 0.05 );
    }
    else
    {
      
player.attr[6] = "";
      
client.frozen = false;
      
setTimer( 0 );
    }
  }
}
function 
onTimeOut()
{
  
client.frozen = true;    
  
player.x = getMoveX( this.accel );
  
player.y = getMoveY( this.accel );
  if ( 
keydown( 1 ) )
  {
    
this.carAngle += .2;  
  }
  if ( 
keydown( 3 ) )
  {
    
this.carAngle -= .2;
  }
  
  
temp.dx = getMoveX( 1 );
  
temp.dy = getMoveY( 1 );
  
player.dir = getdir( temp.dx - player.x, temp.dy - player.y );
  if ( 
keydown( 0 ) )
  {
    
this.accel = this.accel + .1 > 1 ? 1 : this.accel + .1;
  }
  else
  {
    
this.accel = this.accel - .1 < 0 ? this.accel = 0 : this.accel - .1;
  }
  
player.x = getMoveX( this.accel );
  
player.y = getMoveY( this.accel );
  
client.car_angle = this.carAngle;
  
player.attr[5] = this.carAngle;
  
  
setAni( "sit", "" );
  
player.attr[6] = "ut_car.gani";

  
setTimer( 0.05 );
}
function 
getMoveX( speed )
{
  return 
player.x - sin( this.carAngle ) * speed;
}
function 
getMoveY( speed )
{
  return 
player.y - cos( this.carAngle ) * speed;
} 
__________________
I am the devil, I am here to do to devils work.
Reply With Quote