Advertisement
Guest User

Untitled

a guest
May 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1.     void AttachToVehicle(CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target)
  2.     {
  3.         Param1< vector > data;
  4.         if ( !ctx.Read( data ) ) return;
  5.        
  6.         if ( type == CallType.Server )
  7.         {
  8.             PlayerBase player = PlayerBase.Cast( SyncPlayerList.GetPlayerFromPID( sender.GetPlayerId() ) );
  9.            
  10.             if ( player == NULL )
  11.                 return;
  12.  
  13.             CarScript car = CarScript.Cast( target );
  14.  
  15.             if ( car == NULL )
  16.                 return;
  17.  
  18.             if ( car.TeleportsInside() )
  19.             {
  20.                 car.AttachAt( player, data.param1 );
  21.             }
  22.         }
  23.     }
  24.  
  25.     void FixPlayerClientSync(CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target)
  26.     {
  27.         if ( type == CallType.Client )
  28.         {
  29.             GetGame().GetPlayer().StartCommand_Move();
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement