Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


  Show Posts
Pages: 1 ... 10 11 [12]
166  Scripting / Script Help / Re: why this doesn't work ? on: July 28, 2012, 02:03:59 pm
yes
167  Scripting / Script Help / why this doesn't work ? on: July 28, 2012, 12:46:20 pm
why this doesn't work ?


Code: [Select]
const RAMP_OBJECT = 1378;

objects <- array( GetMaxPlayers(), -1 );


function SpawnRamp( id, boost )
{
   local plr = FindPlayer( id );
   if ( plr )
   {
      local pos = plr.Pos;
      local rot = plr.Angle, rad = rot * PI / 180.0;
     
      local x = pos.x, y = pos.y;
      local x2 = x + 1.0 * cos(rad) - 25.0 * sin(rad);
      local y2 = y + 1.0 * sin(rad) + 25.0 * cos(rad);
     
      if ( objects[id] != -1 )
      {
         local obj = FindObject( objects[id] );
         if ( obj )
         {
            obj.Pos = Vector( x2, y2, pos.z - 0.3 );
            obj.Angle = Vector( 0.0, 0.0, rot + 270.0 );
         }
      }
      else
      {
         local obj = CreateObject( RAMP_OBJECT, Vector( x2, y2, pos.z ), Vector( 0.0, 0.0, rot + 270.0 ) );
         if ( obj )
         {
            objects[id] = obj.ID;
         }
      }
     
      if ( boost ) Boost( plr );
   }
}

function Boost( plr )
{
   local veh = plr.Vehicle;
   if ( veh )
   {
      local vel = veh.Velocity;
      vel.x *= 1.5;
      vel.y *= 1.5;
      vel.z *= 1.5;
     
      veh.Velocity = vel;
   }
}

function Fix( plr )
{
   local veh = plr.Vehicle;
   if ( veh )
   {
   plr.Vehicle.Fix();
   }
}

function Flip( plr )
{
   local veh = plr.Vehicle;
   if ( veh )
   {
    plr.Vehicle.Fix();
   local rot = plr.Vehicle.Angle;
   plr.Vehicle.Pos = plr.Vehicle.Pos;
   plr.Vehicle.Angle = rot;
   }
}

function Jump( plr )
{
   local veh = plr.Vehicle;
   if ( veh )
   {
   local vel = veh.Velocity;
   vel.x += 0;
   vel.y += 0;
   vel.z += 0.5;

    veh.Velocity = vel;
   }
}

function onPlayerPart( plr, reason )
{
   local id = plr.ID;
   if ( objects[id] != -1 )
   {
      local obj = FindObject( objects[id] );
      if ( obj )
      {
         obj.Remove();
         objects[id] = -1;
      }
   }
   
   return 1;
}

_______________________________________________________________________________


Code: [Select]
function onScriptLoad()
{
   BindKey( 'O', BINDTYPE_DOWN, "Ramp" );
   BindKey( 'P', BINDTYPE_DOWN, "RampWithBoost" );
   BindKey( 'I', BINDTYPE_DOWN, "Boost" );
   BindKey( 'U', BINDTYPE_DOWN, "Fix" );
   BindKey( 'Z', BINDTYPE_DOWN, "Flip" );
   BindKey( '2', BINDTYPE_DOWN, "Jump" );

   g_pLocalPlayer <- FindLocalPlayer();
   
   return 1;
}

function Ramp()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Ramp", g_pLocalPlayer.ID, false );
      }
   }
}

function RampWithBoost()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Ramp", g_pLocalPlayer.ID, true );
      }
   }
}

function Boost()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Boost", g_pLocalPlayer );
      }
   }
}

function Fix()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Fix", g_pLocalPlayer );
      }
   }
}

function Flip()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Flip", g_pLocalPlayer );
      }
   }
}

function Jump()
{
   local veh = g_pLocalPlayer.Vehicle;
   if ( veh )
   {
      local driver = veh.Driver;
      if ( driver && driver.ID == g_pLocalPlayer.ID )
      {
         CallServerFunc( "binds/binds.nut", "Jump", g_pLocalPlayer );
      }
   }
}
168  Scripting / Script Help / Re: help in Sphere on: July 27, 2012, 02:00:42 pm
thanks man
169  Scripting / Script Help / help in Sphere on: July 27, 2012, 01:40:01 pm
how can i make Sphere  function onScriptLoad( )  how ?????
i have made it but the server sad error
170  Scripting / Script Releases / Re: Staunton Gangwar on: July 18, 2012, 12:04:40 pm
 8)  nice :D
171  Scripting / Script Releases / Re: Blip Script Release on: July 04, 2012, 01:43:56 pm
file ::) not found
172  Scripting / Script Help / i need help :P on: June 29, 2012, 08:26:57 pm
  ;D how can i make Pictures homed and garages on map
173  Liberty Unleashed / Liberty Unleashed Chat / i need help in scripts . on: June 12, 2012, 03:23:35 pm
i need to know how can i open garages in game and thanks .
174  Liberty Unleashed / Suggestions / help help on: June 10, 2012, 01:15:31 pm
 :'( admin i need players play with me ,this players from computer , can you make this ?
Pages: 1 ... 10 11 [12]
© Liberty Unleashed Team.