Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.             if (Game.IsControlJustPressed(0, Control.DropWeapon))
  2.             {
  3.                 var pos = API.GetOffsetFromEntityInWorldCoords(API.PlayerPedId(), 0f, 2f, 0f);
  4.  
  5.                 // store netId to refer to the entity elsewhere
  6.                 var netId = await NetworkEntity.CreateNetworkVehicle(
  7.                     VehicleHash.Caddy, pos.X, pos.Y, pos.Z, API.GetEntityHeading(API.PlayerPedId()) + 90f));
  8.  
  9.                 // sample usage of the entity through netId
  10.                 API.SetVehicleEngineHealth(API.NetToVeh(netId), 250f);
  11.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement