public static long?UID(this GTANetworkAPI.Entity entity) { if (entity.HasSharedData("UID")) { return(entity.GetSharedData("UID")); } return(null); }
public static object GetValue(this GTANetworkAPI.Entity entity, string strKey) { if (entity.HasSharedData(strKey)) { return(entity.GetSharedData(strKey)); } return(null); }
public static bool AssignUID(this GTANetworkAPI.Entity entity, long uid) { if (entity.HasSharedData("UID")) { return(false); } entity.SetSharedData("UID", uid); return(true); }
public void Veh(Client player, string vehicleName = "") { if (player.HasData("PERSONAL_VEHICLE")) { Entity veh = player.GetData("PERSONAL_VEHICLE"); veh.Delete(); player.ResetData("PERSONAL_VEHICLE"); } VehicleHash vehHash = NAPI.Util.VehicleNameToModel(vehicleName); if (vehHash.ToString().Equals("0")) { return; } Vehicle v = NAPI.Vehicle.CreateVehicle(vehHash, player.Position.Around(5), 0f, 0, 0); v.NumberPlate = "STATIQUE"; v.WindowTint = 5; v.NumberPlateStyle = 2; player.SetData("PERSONAL_VEHICLE", v); NAPI.Chat.SendChatMessageToPlayer(player, "Spawned a " + vehicleName + "."); }
public static Vector3 GetPositionAtFront(this GTANetworkAPI.Entity entity, float distance) { return(entity.Position.GetPointFromDistanceRotation(distance, -entity.Rotation.Z)); }
public static bool SetValue(this GTANetworkAPI.Entity entity, string strKey, object value) { entity.SetSharedData(strKey, value); return(true); }